home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / WAIS / doc / z3950-spec.txt < prev   
Encoding:
Text File  |  1992-02-02  |  123.7 KB  |  2,627 lines

  1.  
  2.  
  3.  
  4.  
  5.                ANSI Z39.50 Version 2
  6.                 THIRD DRAFT
  7.                    (Z39.50/V2D3)
  8.                  May 1991
  9.  
  10.  
  11. This is an interim draft, for internal NISO use, subject to review and
  12. revision.
  13.  
  14. STATUS: This is the third draft of version 2 of ANSI Z39.50-1988
  15. (Z39.50/V2D3).
  16.  
  17.  
  18. 1.  INTRODUCTION
  19.  
  20.     This is one of a set of standards produced to facilitate the
  21. inter-connection of computer systems.  It is positioned with respect to
  22. other related standards by the Open Systems Interconnection (OSI) basic
  23. reference model (ISO 7498). The aim of Open Systems Interconnection is to
  24. allow the interconnection of computer systems, with a minimum of technical
  25. agreement outside the interconnection standards.
  26.     
  27.     This standard defines a protocol within the application layer of the
  28. reference model, and is concerned in particular with the retrieval of
  29. information stored in machine readable databases.
  30.  
  31.  
  32. 1.1  SCOPE AND FIELD OF APPLICATION 
  33.  
  34.     This standard describes the Information Retrieval application service
  35. (section 3) and specifies the Information Retrieval application protocol
  36. (section 4), for Open Systems Interconnection.
  37.  
  38.     The Information Retrieval application service is described in terms of
  39. services which provide capabilities within an application.  The description
  40. neither specifies nor constrains the implementation within a computer
  41. system. The purpose of the service description is to define the functions
  42. that the protocol must support.
  43.  
  44.     The protocol specification includes the definition of the protocol
  45. control information, the rules for exchanging this information, and the
  46. conformance requirements to be met by implementation of this protocol.
  47.  
  48.     This standard is intended particularly for use in the area of library
  49. and information sciences. It addresses connection-oriented,
  50. program-to-program communication utilizing telecommunications.  It does not
  51. address the interchange of information with terminals or via other physical
  52. media.
  53.   
  54.  
  55.  
  56. 1.2  MODEL 
  57.  
  58.     The objective of this standard is to facilitate the open
  59. interconnection of database users with database providers. It is necessary
  60. to distinguish between the set of OSI standards and the hardware and
  61. software implementation of a system using the protocols specified in these
  62. standards.  The ways in which databases are implemented differ
  63. considerably; different systems have different styles for describing the
  64. storage of data and the means by which it can be accessed. A common,
  65. abstract model is therefore used in describing databases, to which an
  66. individual system can map its implementation.  This enables different
  67. systems to communicate in standard, mutually understandable terms.
  68.  
  69.     The term "database" as used in this standard refers to a collection of
  70. one or more files, each with a unique name. A group of files within a
  71. database may also have a name and be accessed as a single database.  The
  72. unit of information for retrieval from a database is a record. All of the
  73. records within a given file have a common structure, contain a common set
  74. of data elements and a common set of access points. An access point is a
  75. unique or non-unique key which can be specified either singly or in
  76. combination with other access points in a search for records.  An access
  77. point may be equivalent to a data element, be derived from a data element,
  78. or the combination of all or part of two or more data elements.
  79.  
  80.     A search query may be applied to a database, specifying values to be
  81. matched against the access points of the database.  The subset of records
  82. formed by applying the search query is termed the result set.  A result set
  83. may itself be referenced in a subsequent search query statement and
  84. manipulated to form a new result set.
  85.  
  86.     For generality, it is assumed that query processing does not
  87. necessarily require physical access to records; a result set is thus
  88. assumed to be the identification of (e.g. pointers to) records, as opposed
  89. to the actual set of records, selected by a query.  (It is not assumed that
  90. the database records are locked.  Methods of concurrency control, which
  91. would prevent modification or deletion of result set records, are not
  92. addressed by this standard.)  A result set may be used as a selection
  93. mechanism for the transfer of records between systems; the result set
  94. itself is considered to be a purely local data structure and is not
  95. transfered (that is, records are transferred, but not the local pointers to
  96. the records).
  97.  
  98.     A generic search query statement is composed of a database name
  99. followed by a query statement.  The Type-1 query statement defined in this
  100. standard consists of either a single access point clause, or several access
  101. point clauses linked by logical operators. For example:
  102.  
  103.     "In the database which is named 'Books' find all of the records for
  104.      which the access point 'title word' contains the value 'evangeline'
  105.      AND the access point 'author' contains the value 'longfellow'".
  106.  
  107. Following the processing of a search, the set of items with the specified
  108. properties (the result set) is made available by the target system, to the
  109. origin system, for subsequent retrieval requests. The logical structure of
  110. a result set is that of a named, ordered list of triples consisting of (a)
  111. an ordinal number corresponding to the position of the triple in the list,
  112. (b) a database name, and (c) a unique record identifier (of local
  113. significance only) within the database named in (b).  A result set item is
  114. referenced by its position within the result set, that is, by (a).
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121. 1.3  REFERENCES
  122.  
  123. ISO 7498 -- Information Processing Systems - Open Systems Interconnection -
  124. Basic Reference Model
  125.  
  126. ISO 8649 -- Information Processing Systems - Open Systems Interconnection -
  127. Service Definition for Association Control Service Element
  128.  
  129. ISO 8650 -- Information processing systems - Open Systems Interconnection -
  130. Service Definition for Association Control Protocol Specification
  131.  
  132. ISO 8822 -- Information Processing Systems - Open Systems Interconnection -
  133. Connection Oriented Presentation Service Definition
  134.  
  135. ISO 8824 -- Information Processing Systems - Open Systems Interconnection -
  136. Abstract Syntax Notation One (ASN.1)
  137.  
  138. ANSI X3.4 -- Information Processing - Coded Character Sets - 7-bit American
  139. National Standard Code for Information Interchange (7-bit ASCII)
  140.  
  141. ISO 2709 -- Documentation - Format for Bibliographic Information
  142. Interchange on Magnetic Tape
  143.  
  144.  
  145. 2.  DEFINITIONS 
  146.  
  147.     In cases below where formal definitions appear in other standards,
  148. references to those standards are given, in those cases descriptions and/or
  149. alternate definitions (indented) are sometimes provided.  Alternate
  150. definitions apply only to the Information Retrieval application service and
  151. protocol, and only within the context of this document.
  152.  
  153. APDU - See Application Protocol Data Unit 
  154.  
  155. Application Association --   See ISO xxxx
  156.  
  157.   For the Information Retrieval service and protocol, an application
  158. association is analogous to an individual communication session between a
  159. database user and a database provider.  Each association consists of an
  160. origin application and a target application, and these roles may not be
  161. reversed within an association.
  162.  
  163. Application Entity --   See ISO xxxx. 
  164.   
  165. Application Protocol --  
  166. See ISO xxxx. 
  167.  
  168.   The rules governing the format and exchange of information
  169.        between an origin and target application. 
  170.  
  171. Application Protocol Control Information --  See ISO xxxx.
  172.  
  173.         The information conveyed by application protocol data units. 
  174.   
  175. Application Protocol Data Unit --   See ISO xxxx.
  176.  
  177.         A unit of data passed between an origin and a target. 
  178.  Application Service User --   See ISO xxxx. 
  179.  
  180.   (The concept of service-user is employed to facilitate the specification
  181. of protocol procedures and is not analogous to the database user.)
  182.  
  183. Connection Oriented Communication --   See ISO xxxx. 
  184.  
  185. Database Provider -- The application which provides access to a database
  186. local to that application.
  187.  
  188. Database User -- The application which accesses a remote database. 
  189.  
  190. Origin Application -- The application that initiates an association and is
  191. the source of requests during the association.
  192.  
  193.         The database user. 
  194.  
  195. Name --   See ISO xxxx. 
  196.  
  197. OSI -- Open Systems Interconnection.
  198.   
  199. Primitive --   See ISO xxxx. 
  200.  
  201. Result set -- An ordered list of triples consisting of (a) an ordinal
  202. number corresponding to the position of the triple in the list, (b) a
  203. database name, and (c) a unique record identifier (of local significance
  204. only) within the database named in (b).  A result set is formed by applying
  205. a search query.
  206.  
  207. Service provider --   See ISO xxxx. 
  208.  
  209. (The concept of service-provider is employed to facilitate the
  210. specification of protocol procedures.  It is not analogous to the database
  211. provider, and it does not refer to providers of telecommunication
  212. services.)
  213.  
  214. Target Application -- The application that accepts an association and is
  215. the sink for requests during the association.
  216.  
  217.         The database provider. 
  218.  
  219. Primitive Name --   See ISO xxxx. 
  220.  
  221.  
  222. 3.  INFORMATION RETRIEVAL SERVICE 
  223.  
  224.     This section defines the Information Retrieval service, which is
  225. supported by the Information Retrieval protocol.
  226.  
  227.  
  228. 3.1  GENERAL CHARACTERISTICS OF THE INFORMATION RETRIEVAL SERVICE 
  229.  
  230.     The service definition describes an activity between two applications
  231. on different computers: an initiating application, the origin, and a
  232. responding application, the target.  The target is associated with one or
  233. more databases. Communication between origin and target is via an
  234. application association.  An association is explicitly established by the
  235. origin and may be explicitly terminated by either origin or target, or
  236. implicitly terminated by a communication failure or other external event.
  237.     The roles of origin and target may not be reversed within an
  238. association. An association cannot be restarted, thus no status information
  239. is retained once an association is released.
  240.  
  241.     The complete application service is composed of the association control
  242. service element, which provides association management, and one or more
  243. specific application services, such as the Information Retrieval
  244. application service.  There are three distinct phases during the life of an
  245. application association: establishment, information transfer, and
  246. termination. The association control service element provides all of the
  247. services required during the establishment and termination phases,
  248. including the selection of an application context specifying, among other
  249. things, the set of service elements which are valid during the information
  250. transfer phase.  Section 4.2.1.2 specifies those services for association
  251. control which are assumed by the Information Retrieval service.
  252.  
  253. 3.2  FACILITIES OF THE INFORMATION RETRIEVAL SERVICE 
  254.  
  255.     There are seven facilities defined by this standard.  All consist of a
  256. single service except the Termination facility, which consists of two
  257. services.
  258.  
  259.     (1) Initialization Facility Init Service: Init request from the origin
  260. followed (possibly after one or more intervening Access-control and/or
  261. Resource-control request/response sequences) by an Init response from the
  262. target
  263.  
  264.     (2) Search Facility Search Service: Search request from the origin
  265. followed (possibly after one or more intervening Access-control and/or
  266. Resource-control request/response sequences) by a Search response from the
  267. target
  268.  
  269.     (3) Retrieval Facility Present Service: Present request from origin
  270. followed (possibly after one or more intervening Access-control and/or
  271. Resource-control request/response sequences) by a Present response from the
  272. target
  273.  
  274.     (4) Result-set-delete Facility Delete Service: Delete request from the
  275. origin followed (possibly after one or more intervening Access-control
  276. and/or Resource-control request/response sequences) by a Delete response
  277. from the target
  278.  
  279.     (5)    Access Control Facility  Access-control service: Access-control
  280. request by the target, following an Init, Search, Present, or Delete
  281. request by the origin, or following a Resource-control or Access-control request/response sequence, and followed by an Access-control response from the origin
  282.  
  283.     (6) Accounting/Resource Control Facility Resource-control Service:
  284. Resource-control request by the target, following an Init, Search, Present,
  285. or Delete request by the origin, or following a Resource-control or
  286. Access-control request/ response sequence, and followed by a
  287. Resource-control response from the origin.
  288.  
  289.     (7)    Termination Facility  The Termination Facility allows an origin or target system to initiate abrupt termination of the association, or an origin system to initiate graceful termination.
  290.   IR-abort Service: IR-abort request by either the origin or the target.
  291.  
  292.   IR-Release Service: IR-release request by the origin followed by an
  293. IR-release response by the target.
  294.  
  295.   The IR-abort and IR-release services map directly onto the A-ABORT and
  296. A-RELEASE services (respectively) of the association control service
  297. element.
  298.  
  299. 3.2.1  Initialization Facility
  300.  
  301. 3.2.1.1 Init Service 
  302.  
  303.     The Init service allows an origin to propose values for initialization
  304. parameters.  The target system may propose alternative values for some of
  305. the parameters.  If so, the origin must either accept the alternative
  306. values proposed by the target or else terminate communication.
  307.  
  308. 3.2.1.1.1 Id/authentication The origin and target agree, outside the scope
  309. of the standard, whether or not this parameter is to be supplied by the
  310. origin, and if so, what the value is.  This value is used by the target to
  311. determine if the origin is authorized to enter into communication with the
  312. target.
  313.  
  314.  
  315. 3.2.1.1.2 Options The Init request specifies either "will use" or "will not
  316. use", and the Init response specifies "will support" or "will not support"
  317. for the following capabilities:
  318.  
  319.            1. search
  320.            2. present
  321.            3. delete
  322.  
  323. If the target specified "will support" for a particular capability, then
  324. the origin may assume that the service will be available and may use the
  325. service during the association, even if the origin had specified "will not
  326. use" for that service.
  327.  
  328.                                                            ORIGIN TARGET
  329.         PARAMETER                                          REQUEST         RESPONSE
  330.     
  331.            Id/authentication                               x (optional)
  332.            Options                                         x                            x  
  333.            Preferred-message-size                          x                            x
  334.            Maximum-record-size                             x                            x
  335.            Result                                                                       x
  336.            User-information-field                          x (optional)                 x (optional)
  337.            Reference-id                                    x (optional)                 x (if applicable)
  338.  
  339.     In addition, the Init request specifies either "will support" or "will
  340. not support", and the Init response specifies "will use" or "will not use"
  341. for each of the following capabilities,
  342.  
  343.            1. resource-control
  344.            2. access-control
  345.  
  346.     If the request specifies "will not support" for a given capability, and
  347. the response specifies "will use" for that capability, then the value of
  348. Result must be "reject".
  349.     
  350.     Note: the above two lists of capabilities are subject to expansion in
  351. future versions of this protocol.
  352.     
  353.     search - The origin specifies "will use" for "search" if it intends to
  354. submit Search requests.  If so, the target indicates that it is willing (or
  355. unwilling) to accept Search requests by specifying "will support" (or "will
  356. not support") for "search".
  357.  
  358.     present - The origin specifies "will use" for "present" if it intends
  359. to submit Present requests.  If so, the target indicates that it is willing
  360. (or unwilling) to accept Present requests by specifying "will support" (or
  361. "will not support") for "present".
  362.  
  363.     delete - The origin specifies "will use" for "delete" if it intends to
  364. submit Delete requests.  If so, the target indicates that it is willing (or
  365. unwilling) to accept Delete requests by specifying "will support" (or "will
  366. not support") for "delete".
  367.  
  368.     resource-control - The origin indicates that it is prepared to receive
  369. and respond to a Resource-control request from the target, by specifying
  370. "will support" for "resource-control".  Conversely, the origin indicates
  371. that it is not prepared to receive a Resource-control request by specifying
  372. "will not support".  In the latter case, if the target cannot suppress
  373. sending a Resource-control request, it should reject the connection by
  374. setting Result to "reject", specifying "will use" for "resource-control",
  375. and (optionally) supplying a text message in the User-information-field.
  376.  
  377.     access-control - Likewise, the origin indicates whether or not it is
  378. prepared to receive and respond to an Access-control request from the
  379. target, by specifying "will support" or "will not support" for
  380. "access-control".
  381.  
  382.     Security is invoked at different levels. In addition to user
  383. authentication at the outset of an association, security might be invoked
  384. to control access to a particular database, record, result-set, or use of a
  385. command.
  386.  
  387.     If the origin is not capable of receiving an Access-control request,
  388. and if security requirements on the target system mandate that security
  389. (other than that which might be provided by the parameter
  390. ID/authentication) be invoked at the outset of an association, then the
  391. target should reject the association by setting the parameter Result to
  392. "reject", and specifying "will use" for "access-control".  However, if the
  393. target invokes security, but not at the association level, then the target
  394. may choose to accept the connection.  In that case, if the target
  395. subsequently receives a command that would trigger an Access-control
  396. request, the target agrees to suppress the request and respond to the
  397. command with an error status indicating that a security challenge was
  398. required but could not be issued.
  399.  
  400.     3.2.1.1.3 Preferred-message-size and Maximum-record-size The Init
  401. request contains Preferred- message-size and Maximum-record-size, specified
  402. in bytes.  Maximum-record-size must be greater than or equal to
  403. preferred-message-size.  The Init response contains both the
  404. Preferred-message-size and Maximum-Record-size that the target is going to
  405. use.
  406.  
  407.     The target has the option of responding with values different from
  408. those requested by the origin (however, Preferred-message-size must be less
  409. than or equal to Maximum-record-size), in which case, the origin may abort
  410. the connection if those values are not acceptable. The usage of these
  411. parameters is specified in section 3.3
  412.  
  413. 3.2.1.1.4 Result The target indicates whether or not it accepts the
  414. association by specifying a value of "accept" or "reject" respectively in
  415. the parameter Result.  If "reject" is indicated, the origin is expected to
  416. terminate communication.
  417.  
  418. 3.2.1.1.5 User-information-field This field may be used by either the
  419. origin or target for additional information, not specified by this
  420. standard.
  421.  
  422. 3.2.1.1.6  Reference-id See section 3.4
  423.  
  424.  
  425. 3.2.2  Search Facility  
  426.  
  427.     The Search facility enables an origin system to query databases at a
  428. target system, and to receive information about the results of the query.
  429.   3.2.2.1 Search Service The Search service allows an origin to send a
  430. query to a target. The basic query concept is: "from the specified set of
  431. items, identify those with the properties indicated."  The set of items
  432. identified is called the "result set", and is maintained by the target for
  433. subsequent retrieval requests.  However, depending on the parameters of the
  434. search, one or more items identified by the result set may be immediately
  435. returned as part of the search response.  The result set is an ordered set;
  436. items identified by entries in the result set are referenced by the
  437. position of the entry within the result set, beginning with one (1).
  438. ________________________________________________________________________
  439.                                                     ORIGIN TARGET
  440.         PARAMETER                                   REQUEST         RESPONSE
  441.            Query-type                               x
  442.            Query                                    x 
  443.            Database-names                           x
  444.            Result-set-name                          x 
  445.            Replace-indicator                        x
  446.            Small-set-element-set-names              x (optional)
  447.            medium-set-element-set-names             x (optional)
  448.            preferred-record-syntax                  x (optional)
  449.            Small-set-upper-bound                    x 
  450.            Large-set-lower-bound                    x
  451.            Medium-set-present-number                x 
  452.            Database/diagnostic-records                               x (if applicable)
  453.            Result-count                                              x 
  454.            Number-of-records-returned                                x 
  455.            Next-result-set-position                                  x 
  456.            Search-status                                             x 
  457.            Result-set-status                                         x (if applicable)
  458.            Present-status                                            x (if applicable)
  459.            Reference-id                             x (optional)     x (if applicable)
  460. ________________________________________________________________________ 
  461.  
  462. 3.2.2.1.1 Query-type and Query The parameter Query-type identifies the
  463. syntax of the query. As noted above, the basic query concept is "from the
  464. specified set of items, identify those with the properties indicated."  The
  465. "specified set of items" is a collection of one or more databases,
  466. specified by the parameter database-names.  The "properties indicated" are
  467. specified by the parameter Query.
  468.  
  469.     The remainder of this clause specifies procedures when Query-type is 1,
  470. 'RPN-query'.
  471.  
  472.     The RPN query has the following structure:
  473.  
  474.                   RPN-query ::= argument | argument + argument + operator
  475.                   argument       ::=  operand | RPN-query
  476.                   operand        ::=  attribute-set + term | Result-set-id
  477.                   operator       ::=  AND | OR | AND-NOT
  478.  
  479. Where       ::=   means "is defined as", 
  480.             |     means  "or", 
  481.             +     means  "followed by", and + has precedence over | (i.e., + is evaluated before |). 
  482.  
  483.       NOTES
  484.       1.    "RPN-query" is recursively defined; it is either
  485.                a) "operand" , or  
  486.                b) "argument + argument + operator".   
  487.  
  488.             In case (b), each occurrence of "argument" can be replaced by
  489. either (a) or (b) and so on.
  490.   
  491.             A structure composed of operators and operands conforms to the
  492. Type-1 query syntax if and only if it is possible, by repeatedly replacing
  493. occurrences of (b) with (a), to reduce the structure to (a).
  494.       2.  "operand" is either (a) attributes-set + term, or (b)
  495. Result-set-id.  In either case it
  496.             represents a set of database records.  For (a) it is the set of
  497. database records obtained by evaluating the specified attribute-set and
  498. term against the collection of databases specified in the Search request
  499. (see NOTE 3).  For (b) it is the set of database records represented by the
  500. result set for which Result-set-id was specified as the value of the
  501. parameter Result-set-name in a previous Search request.
  502.       3.  Different attribute sets will be defined and registered (Appendix
  503. C defines and registers attribute-set bib-1).  An example of an
  504. attribute-set/term combination is 'title word'/ 'evangeline'; in this case,
  505. evaluation of attribute-set/term against a database would result in the
  506. identification of all of the records in the database for which the access
  507. point 'title word' contains the value 'evangeline'.
  508.  
  509. Representation and Evaluation of the Type-1 Query
  510.  
  511.       At the origin system, the Type-1 query is represented by a tree.
  512. Each leaf node contains a simple operand and each non-leaf node contains a
  513. complex operand. A simple operand is either a Result-set- id or an
  514. Attribute-set+Term.  A complex operand is a subtree whose root is an
  515. operator and which contains two subtrees: a left-hand operand and a
  516. right-hand operand, LO and RO. A complex operand is thus one of the
  517. following:
  518.  
  519.       -  LO AND RO, represnting the intersection of LO and RO;
  520.       -  LO OR RO, rperesenting the union of LO and RO; or
  521.       -  LO AND-NOT RO, representing the set of elements in LO that are not in RO.
  522.  
  523.       At the target, evaluation of the tree is illustrated by the use of a stack. The tree is processed
  524.       according to a left post-order traversal.  Each leaf-node is one of the following: 
  525.  
  526.       a)    Attribute-set + Term 
  527.       b)    Result-set-id 
  528.       c)    Operator
  529.  
  530. Whenever (a) is encountered, it is evaluated against the collection of
  531. databases specified in the Search request, and the result is put on the
  532. stack.  Whenever (b) is encountered, it is put on the stack.
  533.  
  534. Whenever (c) is encountered, the last two items (i.e. sets, see NOTE 2
  535. above) that have been put on the stack are pulled off and the operator is
  536. applied as follows:
  537.  
  538.       -  if operator is AND, the result is the intersection of the two sets, 
  539.       -  if operator is OR, the result is the union of the two sets, 
  540.       -  if operator is AND-NOT, the result is the set of elements in the
  541. first set (i.e., the first of the two sets to have been placed on the
  542. stack) which are not in the second set.
  543.  
  544. The resulting set is then put on the stack.  
  545.  
  546. When evaluation of the query is complete (i.e. all query-terms have been
  547. processed) there will be one item remaining on the stack (otherwise the
  548. query is in error) which is the result of the query.
  549.  
  550.       The following examples illustrate query evaluation.  In these
  551. examples, D represents the collection of databases specified in the Search
  552. request, R represents a Result-set-id, and A, B, and C represent
  553. attribute-list/term combinations such as "subject = dogs".
  554.  
  555.  1.   Query  =   A      
  556.             Result:     the records in D for which A is true 
  557.  2.   Query  =  A  B  C  AND  OR 
  558.             Result:     the records in D for which both B and C are true, or A is true 
  559.  3.   Query  =  A  B  AND  C  OR
  560.             Result: the records in D for which both A and B are true, or C is true
  561.  4.   Query  =   R  A  AND 
  562.             Result:     the records in D for which both (1) A is true, and (2) which are also in result set
  563.                         R
  564.  5.    Query  =   R  A  OR 
  565.             Result:     the records in  D for which A is true, together with records in R
  566.  
  567.  
  568. 3.2.2.1.1.a Database-name The target designates, by agreement outside the
  569. scope of the standard, what databases may be specified on a Search request,
  570. and also in what combinations they may be specified.  For example, a target
  571. might specify that databases A, B, and C, may be searched individually, and
  572. that A and B may be searched in combination (but not A and C, nor B and C).
  573. If an origin requests a combination of databases which is not supported,
  574. the search will result in a diagnostic such as "combination of specified
  575. databases not supported" (see appendix D).
  576.  
  577. 3.2.2.1.2 Result-set-name and Replace-indicator The parameter
  578. Result-set-name specifies a name to be given to the result set which will
  579. be created by the query so that it may be subsequently referenced within
  580. the same association.  If a result set with the same name already exists at
  581. the target, then the action taken depends on the value of the parameter
  582. Replace-indicator, as follows:
  583.  
  584.      - If the value of Replace-indicator is "on", then prior to processing
  585. the query, the existing result set whose name is specified by the parameter
  586. Result-set-name will be deleted, and a new result set by that name created.
  587. The initial content of the result set is null.
  588.  
  589.      - If the value of Replace-indicator is "off", the search is not
  590. processed, an error diagnostic is returned by the target, and the existing
  591. result set whose name is specified by the parameter Result-set-name is left
  592. unchanged.
  593.  
  594.     If a result set does not exist with the name specified by the parameter
  595. Result-set-name, then a result set by that name is created by the target,
  596. and the parameter Replace-indicator is ignored.  The initial content of the
  597. result set is null.  If no records are found by the query, the result set
  598. remains null.
  599.  
  600.     A target system need not support, in general, the naming of result sets
  601. by the origin (see however section 4.4.3, "Statement Requirements" for
  602. Conformance).  However, a target system must support at least the result
  603. set whose name is "default". If the origin specifies "default" as
  604. Result-set-name, then Replace-indicator must be "on".
  605.  
  606.     A result set which is created by a Search request (that is, specified
  607. by the parameter Result-set-name) may be referenced in a subsequent Present
  608. request or as an operand in a subsequent Search request (for example, in a
  609. Type-1 query).  If a result set named "default" is created, it remains
  610. available for reference from the time it is created until the end of the
  611. association during which it is created, or until either:
  612.  
  613.       - another "default" result set is created, because the name "default"
  614. is specified as Result-set-name in a subsequent Search request, or
  615.  
  616.       -    it is unilaterally erased or deleted by the target.
  617.     
  618.     Any result set other than the result set named "default" remains
  619. available for reference from the time it is created until it is deleted in
  620. one of the following ways:
  621.     
  622.       -    by a Delete request 
  623.       -    implicitly, because a result set was specified by the same name in a Search request, and the
  624.            value of the parameter Replace-indicator was "on"
  625.       -    unilaterally by the target (at any time)
  626.       -    by termination of the association.
  627.  
  628. 3.2.2.1.3 Small-set-element-set-names and Medium-set-element-set-names An
  629. element set name is a primitive name which specifies a particular subset of
  630. the elements in a database record which are to compose the response
  631. records.  The specified subset is made up of components of the
  632. abstract-syntax description of the database records and is, therefore, a
  633. formal subset of that abstract-syntax-definition.  Element set names are
  634. specified, along with their definitions, for a given database, by the
  635. target, outside of this standard.  The target specifies a default element
  636. set for each database.
  637.  
  638.     The parameters Small-set-element-set-names and
  639. Medium-set-element-set-names describe the preferred record composition of
  640. the records expected in the search response.  If the query results in a
  641. small-set (see 3.2.2.1.4), then Small-set-record-element-set-names
  642. pertains.  If the query results in a medium-set, then
  643. Medium-set-record-element-set-names pertains.
  644.  
  645.     Each of the two parameters is a set of one or more pairs of a database
  646. name and associated element set name.  For each database record returned in
  647. a Search (or Present) response, if the given database is specified (as a
  648. component of one of the pairs comprising the pertaining element set name)
  649. then the response record should be composed according to the corresponding
  650. element set name.  If not, the response record should be composed according
  651. to the default element set name for that database. If a record composition
  652. name is specified which is not valid for the corresponding database, then
  653. the Search Response APDU will include a diagnostic, such as "record
  654. composition name not valid for database", and the value of the parameter
  655. Search-Status will be "failure".
  656.  
  657.     Each of the two parameters may alternatively consist of a single
  658. element set name (from those defined by the target system), with no
  659. database specified.  In that case, for each database record returned in a
  660. Search (or Present) response:
  661.  
  662.      -     if the specified element set name is valid for the given
  663. database, the response-record should  be composed according to that element set name; 
  664.     -      if the specified element set name is not valid for the given
  665. database, the response-record  should be composed according to the default element set name for that database.
  666.  
  667. A target system must always recognize the character string "F" as an
  668. element set name to mean "full record".  When a "full record" is requested,
  669. the target returns all of the elements stored in its database for the
  670. requested record.  For a given record, the set of elements included in a
  671. "full record" in one database might not be the same set of elements
  672. included in a "full record" in another database.  (The target may use "F"
  673. as the default element set name.)
  674.  
  675. 3.2.2.1.3a Preferred-record-syntax The parameter Preferred-record-syntax
  676. identifies the preferred abstract syntax for the records to be returned,
  677. from among the set of abstract syntaxes for records for which presentation
  678. contexts are currently established for this application association.  If
  679. the target cannot supply the information in the requested abstract syntax,
  680. it will supply it in one of the other abstract syntaxes from the
  681. established set.
  682.  
  683. 3.2.2.1.4 Small-set-upper-bound, Large-set-lower-bound, and
  684. Medium-set-present-number The number of database records identified by the
  685. result set is referred to as the result-count.  The result set is
  686. considered either a "small-set", a "medium-set", or a "large-set",
  687. depending on the result-count and the parameters of the search.  The result
  688. set is a small-set if Result-count is not greater than
  689. small-set-upper-bound.  The result set is a large-set if Result-count is
  690. larger than or equal to Large-set-lower-bound. Otherwise, the result set is
  691. a medium-set.
  692.  
  693.     If the query results in a small-set, all database records identified by
  694. the result set are to be returned to the origin (subject to possible
  695. message size constraints). If the query results in a large-set, no database
  696. records are to be returned.  If the query results in a medium-set, the
  697. maximum number of database records to be returned is specified by
  698. Medium-set-present-number.
  699.  
  700. Notes:   (1)        The result set may be a medium-set only when Result-count is greater than small-set-
  701. upper-bound and less than Large-set-lower-bound, and this can only occur if Large-
  702. set-lower-bound is at least 2 greater than Small-set-lower-bound; i.e., the result set
  703. cannot be a medium-set if Large-set-lower-bound exceeds Small-set-upper bound by
  704. one. For example, if Large-set-lower-bound is 11 and Small-set-upper-bound is 10,
  705. the intent is "if 10 or less records are found return them all, otherwise do not return
  706. any"; and medium-set-present-number would not apply. 
  707.           (2)       Small-set-upper-bound may be zero.  Large-set-upper-bound must be greater than
  708. Small-set-upper-bound.
  709.           (3)       If the origin does not want any records returned in the response regardless of the
  710. value of Result-cound, Larger-set-lower-bound should be set to 1 and
  711. Small-set-upper-bound to zero. 
  712.  
  713. 3.2.2.1.5 Database/diagnostic-records The target processes the search,
  714. creating a result set which identifies a set of database records.  It
  715. cannot be assumed however that search processing requires physical access
  716. to the database records; thus one or more records might not be returnable,
  717. but this circumstance might not be recognized until an attempt is made to
  718. transfer such a record.
  719.  
  720.     After processing the search, the target attempts to retrieve the first
  721. N records identified by the result set, to be included in the Search
  722. response (N depends on the search parameters and result-count, as described
  723. in 3.2.2.1.4). For each record which cannot be returned, a surrogate
  724. diagnostic record is substituted.  Thus the parameter
  725. Database/diagnostic-records is one of the following:
  726.  
  727.     -      N database and/or diagnostic records, 
  728.     -      a number of database and/or diagnostic records, which is less than N because of message size
  729.            constraints (see 3.3),
  730.     -      a single non-surrogate diagnostic record indicating that the search cannot be processed, and
  731.            why it cannot be processed, or
  732.     -      a single non-surrogate diagnostic record indicating that records cannot be presented, and why
  733.            not ", e.g. record composition name not valid for database".
  734.  
  735.     The order of occurrence of records (database and/or surrogate
  736. diagnostic) within the parameter Database/diagnostic-records is according
  737. to the order in which they are identified by the result set.  Each database
  738. or surrogate diagnostic record may optionally be accompanied by the name of
  739. the database in which the record resides.  However, the database name must
  740. accompany the first database or surrogate diagnostic record being returned,
  741. and must accompany any record coming from a database different than its
  742. immediate predecessor.
  743.  
  744. 3.2.2.1.6 Result-count and Number-of-records-returned The parameter
  745. Result-count is the number of records identified by the result set.  If the
  746. result set is empty, result-count is zero.  The parameter
  747. Number-of-records-returned is the total number of records (database and
  748. diagnostic) returned in the Search response.
  749.  
  750. 3.2.2.1.7 Next-result-set-position The parameter Next-result-set-position
  751. specifies the position within the result set of the next record following
  752. those returned (or zero if the last record in the result set is being
  753. returned).
  754.  
  755. 3.2.2.1.8 Search-status The parameter Search-status is returned in the
  756. response and assumes one of the following two values:
  757.  
  758.     success -       the search completed successfully
  759.     failure -       the search did not complete successfully
  760.     A value of "success" does not imply that the expected database and/or
  761. surrogate diagnostic records are being returned as part of the response
  762. (see Present-status, 3.2.2.1.9). Note also, a value of "success" does not
  763. imply that any records were located by the search.  A value of "failure"
  764. does imply that none of the expected database and/or surrogate diagnostic
  765. records is being returned.  In the latter case, the target returns a single
  766. diagnostic record indicating that the search cannot be processed.
  767.  
  768.  3.2.2.1.9 Result-set-status and Present-status These are status
  769. descriptors necessary to dissambiguate certain situations that can occur
  770. during search and present operations.
  771.  
  772.     Result-set-status occurs if and only if the value of Search-status is
  773. "failure", and its value is one of the following:
  774.            subset     -       Partial, valid results available.
  775.            interim    -       Partial results available, not necessary valid.
  776.            none       -       No results available (result set is null).
  777.     Present-status occurs if and only if the value of Search-status is
  778. "success", and its value is one of the following:
  779.            success     -      All of the expected database (or surrogate diagnostic) records are available.
  780.            partial-1   -      Not all of the expected records can be returned because the request was
  781.                               terminated by access-control.
  782.            partial-2   -      Not all of the expected records can be returned because the request was
  783.                               terminated by maximum message size.
  784.            partial-3   -      Not all of the expected records can be returned because the request was
  785.                               terminated by resource-control at origin.
  786.            partial-4   -      Not all of the expected records can be returned because the request was
  787.                               terminated by resource-control at target.
  788.            failure     -      None of the expected database (or surrogate diagnostic) records can be
  789.                               returned.  A single diagnostic is returned, which is not a surrogate for a
  790.                               database record.
  791.  
  792. 3.2.2.1.10  Reference-id  See section 3.4 
  793.  
  794.  
  795. 3.2.3  Retrieval Facility 
  796.  
  797.     The Retrieval facility enables the origin to retrieve a copy of records
  798. according to position within a result set maintained by the target.
  799.  
  800. 3.2.3.1 Present Service The Present service allows the origin system to
  801. retrieve records from a specified result set.  Records are referenced by
  802. relative position within the result set.  The origin specifies a range of
  803. records to be retrieved and may follow with subsequent requests specifying
  804. different ranges.  For example, the origin may retrieve records one through
  805. five and follow with a request for records four through six.
  806. ________________________________________________________________________
  807.                                                     ORIGIN                        TARGET 
  808.  PARAMETER                                          REQUEST                       RESPONSE
  809.  Number-of-records-requested                        x 
  810.  Result-set-start-position                          x 
  811.  Result-set-id                                      x 
  812.  Element-set-names                                  x (optional)
  813.  Preferred-record-syntax                            x (optional)
  814.  Database/diagnostic-records                                                      x (if applicable) 
  815.  Number-of-records-returned                                                       x
  816.  Next-result-set-position                                                         x      
  817.  Present-status                                                                   x 
  818.  Reference-id                                       x (optional)                  x (if applicable)
  819. ________________________________________________________________________ 
  820.  
  821. 3.2.3.1.1 Number-of-records-requested and Result-set-start-position The
  822. origin requests the return of N records beginning at record M, from the
  823. result set, where N = Number-of-records-requested and M = Result-set-start-
  824. position (and N is not greater than Result-count - M + 1).
  825.  
  826. 3.2.3.1.2 Result-set-id Result-set-id specifies the result set from which
  827. records are to be retrieved.  It is the result set created by a previous
  828. Search request for which the value of the parameter Result- set-name
  829. matches the value of Result-set-id.
  830.  
  831. 3.2.3.1.3 Element-set-names The parameter Element-set-names describes the
  832. preferred record composition of the records expected in the Present
  833. response. See section 3.2.2.1.3.
  834.  
  835. 3.2.3.1.4  Preferred-record-syntax  See section 3.2.2.1.3.
  836.  
  837. 3.2.3.1.5 Database/diagnostic-records The parameter
  838. Database/diagnostic-records returned by the target consists of one of the
  839. following:
  840.   - N database and/or diagnostic records, where N = Number-of-records-requested,
  841.   - a number of database and/or diagnostic records, which is less than N (reason specified by Present-
  842.     status), or
  843.   - a single diagnostic record indicating that the request cannot be processed, and why it cannot be
  844.     processed. 
  845.  
  846.     The order of occurrence of records (database and/or surrogate
  847. diagnostic) within the parameter Database/diagnostic-records is according
  848. to the order in which they are identified by the result set.  Each database
  849. and/or surrogate diagnostic record may optionally be accompanied by the
  850. name of the database in which the record resides.  However, the database
  851. name must accompany the first record being returned, and must accompany any
  852. record coming from a database different than its immediate predecessor.
  853.  
  854. 3.2.3.1.6 Number-of-records-returned and Next-result-set-position The
  855. parameter Number-of-records-returned is the total number of database and
  856. diagnostic records returned.  Next-result-set-position is the position
  857. within the result set of the next record following the last database or
  858. surrogate diagnostic record being returned (or zero, if the last database
  859. or surrogate diagnostic record in the result set is being returned).
  860.  
  861. 3.2.3.1.7 Present-status Present-status is mandatory in a Present response
  862. and its values are the same as those listed for Present-status in
  863. 3.2.2.1.9.
  864.  
  865. 3.2.3.1.8 Reference-id  See section 3.4
  866.  
  867.  
  868. 3.2.4  Result-set-delete Facility  
  869.  
  870.     The Result-set-delete facility enables an origin system to instruct a
  871. target system to delete one or more result sets known to the target system.
  872. The target system responds with information pertaining to the result of the
  873. operation.
  874.  
  875. 3.2.4.1 Delete Service Element
  876.  
  877.     The Delete service element enables an origin system to send a Delete
  878. request to the target.  The origin system may request deletion of specified
  879. result sets held by the target system, or all result sets currently on the
  880. target system created during this association.  The target responds by
  881. reporting the status of the requested delete operation.
  882. ________________________________________________________________________
  883.                                                     ORIGIN                        TARGET 
  884.            PARAMETER                                REQUEST                       RESPONSE
  885.     Delete-operation                                x
  886.     Result-set-list                                 x (if applicable)
  887.     Delete-status                                                                 x
  888.     List-statuses                                                                 x (if applicable)
  889.     Number-not-deleted                                                            x (if applicable)
  890.     Bulk-statuses                                                                 x (if applicable)
  891.     Delete-msg                                                                    x (optional)
  892.     Reference-id                                    x (optional)                  x (if applicable)
  893. ________________________________________________________________________ 
  894.  
  895. 3.2.4.1.1 Delete-operation The origin specifies one of the following:
  896.      list - delete one or more specified result sets (see 3.2.4.1.2), or
  897.      Bulk-delete - delete all result sets currently on the target system
  898. created during this association.
  899.  
  900. 3.2.4.1.2 Result-set-list If Delete-operation is "list", then the parameter
  901. Result-set-list must be present, and specifies a list of result sets to be
  902. deleted, each of which was created by a previous Search request for which
  903. the value of the parameter Result-set-name matches the value of one of the
  904. members of the list.  If Delete-operation is "Bulk-delete", then the
  905. parameter Result-set-list must not be present.
  906.  
  907. 3.2.4.1.3 Delete-status Delete-status is used by the target to report the
  908. status of the delete request.  It assumes one of the values "success" or
  909. "failure-3" through "failure-9" in table 3.2.4-1.
  910.  
  911. 3.2.4.1.4 List-statuses
  912.  
  913.     List-statuses is present in a Delete response for a list operation. It
  914. contains the same Result-set-id(s) contained in the Result-set-list
  915. parameter of the corresponding Delete request.  Each result-set-id in the
  916. List-statuses parameter is paired with a status.  Possible status values
  917. are "success" and "failure-1" through "failure-6" in table 3.2.4-1.
  918.  
  919. _______________Table 3.2.4-1___________________________________
  920.            success    -       Result set(s) deleted.
  921.            failure-1  -       Result set did not exist.
  922.            failure-2  -       Result set previously unilaterally deleted by target.
  923.            failure-3  -       System problem at target (optional text message may be included in the
  924.                               Delete-msg parameter).
  925.            failure-4  -       Access-control failure: the delete request caused the target system to issue
  926.                               an Access-control request which the origin system failed to satisfy, or the
  927.                               origin could not accept an Access-control request.
  928.            failure-5  -       Request terminated by origin system through resource control.
  929.            failure-6  -       Access terminated by target system due to resource constraints.
  930.            failure-7  -       Bulk delete of result sets not supported by target.
  931.            failure-8  -       Not all result sets deleted (on a bulk delete request) (see 3.2.4.1.4).
  932.            failure-9  -       Not all requested result sets deleted.
  933.     Note: failure-7 and failure-8 can occur only if Delete-operation is Bulk-delete.
  934. ________________________________________________________________________________
  935.  
  936. 3.2.4.1.4 Number-not-deleted and Bulk-statuses These two parameters occur
  937. only if Delete-operation is Bulk-delete and if Delete-status = "failure-8".
  938. The parameter Number-not-deleted indicates how many result sets were not
  939. deleted, and the parameter Bulk-statuses gives individual statuses for
  940. those not deleted.
  941.  
  942.     Note, however, that a target system is not obligated to provide
  943. statuses for each result set not deleted on a bulk delete.  For example, a
  944. target system may abort a bulk delete when the first failure to delete a
  945. result set that is part of the bulk delete fails; in this case only a
  946. single status might be included in the parameter Bulk-statuses.
  947.  
  948.     If a bulk delete results in more statuses than can fit into a single
  949. Delete-response message, the target system may discard those which do not
  950. fit.
  951.  
  952. 3.2.4.1.5 Delete-msg Delete-msg, if present, contains an optional text message. 
  953.  
  954. 3.2.4.1.6 Reference-id  See section 3.4 
  955.  
  956. 3.2.5  Access Control Facility
  957.  
  958.     The Access-control facility allows a target system to challenge an
  959. origin system during execution of an Init, Search, Present, or Delete
  960. operation.
  961.  
  962.     An origin system must be prepared to accept and respond to one or more
  963. Access-control requests while an Init, Search, Present, or Delete request
  964. is being executed by the target system (unless the parameter Options of the
  965. Init request which initiated the connection did not include Access-control;
  966. see 3.2.1.1.2).  For example, after sending a Search request, the origin
  967. must be prepared to receive an Access-control request, respond with an
  968. Access-control response, then later receive another Access- control
  969. request, etc., before receiving a Search response.
  970.  
  971.     Once the origin has responded, the operation proceeds as if the
  972. challenge has never taken place.  If the origin system fails to respond
  973. correctly to the challenge during a Search, Present, or Delete request,
  974. then the Search, Present, or Delete response may indicate that the
  975. operation was terminated due to an Access-control failure.  (Note: During a
  976. Search or Present operation, while the target is preparing records for
  977. presentation, it might send an Access Control request pertaining to a
  978. particular record. If the origin fails to respond correctly to the
  979. challenge, the target may simply substitute a surrogate diagnostic:
  980. "security challenge failed; record not included".) If the origin system
  981. fails to respond correctly to the challenge during an Init request, the
  982. target may set the Result parameter to "reject" and may (optionally) supply
  983. such an indication in the User-information-field of the Init response.
  984.  
  985.     The Access-control request/response mechanism can be used to support
  986. password challenges, public key cryptosystems, or algorithmic
  987. authentication, etc.  The specific content of the Access-control request
  988. and response parameters are outside the scope of this standard.
  989.                                                                                                            
  990. 3.2.5.1 Access-control Service 
  991. ________________________________________________________________________
  992.                                                     TARGET                        ORIGIN 
  993.            PARAMETER                                REQUEST                       RESPONSE
  994.            Security-challenge                       x                   
  995.            Security-challenge-response                                            x
  996.            Reference-id                             x (if applicable)             x (if applicable)
  997. ________________________________________________________________________
  998.  
  999. 3.2.5.1.1 Security-challenge and Security-challenge-response The contents
  1000. of these two parameters are outside the scope of this standard and must be
  1001. established by prior agreement between a given target/origin system pair.
  1002.  
  1003. 3.2.5.1.2 Reference-id  See section 3.4.  
  1004.  
  1005.  
  1006. 3.2.6 Accounting/Resource Control Facility
  1007.  
  1008.     The Accounting/resource Control facility permits the target system to
  1009. notify the origin system when either actual or predicted resource
  1010. consumption will exceed agreed upon limits (or limits built into the target
  1011. system), and to obtain the origin system's consent to continue.  In
  1012. addition, the target system can inform the origin system about the current
  1013. status of a result set being generated on the target in response to a
  1014. Search request, and indicate information about the status of the current
  1015. request to the origin.
  1016.  
  1017.  
  1018. 3.2.6.1 Resource-control Service   
  1019.  
  1020.     A target system may issue a Resource-control request in response to an
  1021. Init, Search, Delete, or Present request.  The origin system must respond
  1022. to the Resource-control request, after which processing continues (from the
  1023. point of view of message sequencing) as if the request/response sequence
  1024. never occured.  An origin should be prepared to respond to multiple
  1025. Resource-control requests during the execution of an Init, Search, Delete
  1026. or Present request.
  1027.  
  1028.     If the origin responds to a Resource-control request with a
  1029. Resource-control response saying to terminate the command, it can expect to
  1030. receive an Init, Search, Present or Delete response.  This response might
  1031. indicate that the request was terminated at origin request.  However, the
  1032. response might alternately indicate that the request completed, since the
  1033. operation at the target system may continue to execute and subsequently
  1034. complete before the Resource-control response reaches the target system.
  1035. ________________________________________________________________________
  1036.                                                     TARGET                        ORIGIN 
  1037.            PARAMETER                                 REQUEST                      RESPONSE
  1038.  
  1039.            Resource-report                          x (optional)
  1040.            Suspended-flag                           x 
  1041.            Partial-results-available                x (if applicable)
  1042.            Continue-flag                                                          x
  1043.            Result-set-wanted                                                      x (if applicable)
  1044.            reference-id                             x (if applicable)             x (if applicable)
  1045. ________________________________________________________________________
  1046.  
  1047. 3.2.6.1.1 Resource-report Resource-report may be used to convey information
  1048. about the current and estimated resource consumption at the target system.
  1049. The format of Resource-report bib-1 is defined in Appendix F.
  1050.  
  1051. 3.2.6.1.2 Partial-results-available The target indicates the status of the
  1052. result set via the flag Partial- results-available, whose value is one of
  1053. the following:
  1054.                 subset        - Partial, valid results available.
  1055.                 interim       - Partial results available, not necessary valid.
  1056.                 none          - No results available.
  1057.  
  1058.     This parameter is meaningful only during a search operation.  If its
  1059. value is "subset" or "interim", then the target will accept subsequent
  1060. Present requests if the current request is terminated by the
  1061. Resource-control response, and if the value of the parameter
  1062. Result-set-wanted is "on".
  1063.  
  1064.     If the value of Partial-results-available is "none" then the target
  1065. need not accept subsequent Present requests in the event that the request
  1066. is terminated by the Resource-control response.
  1067.  
  1068.     Note that if Suspended-flag is off, the partial results available
  1069. situation may change since processing continues on the search.  In all
  1070. cases, the values of Search-status and Result-set-status in the Search
  1071. response should be treated as the authoritative information.
  1072.  
  1073. 3.2.6.1.3 Suspended-flag The target system indicates whether or not
  1074. processing of the command has been suspended pending the Resource-control
  1075. response.
  1076.  
  1077. 3.2.6.1.4 Continue-flag The origin indicates to the target whether or not
  1078. to continue processing.
  1079.  
  1080.  
  1081. 3.2.6.1.5  Result-set-wanted  This flag  is meaningful only:
  1082.            -        during a Search request, 
  1083.            - when the value of Partial-results-available is "subset" or
  1084. "interim", and
  1085.            - when the value of the parameter Continue-flag is "do not
  1086. continue".
  1087.  
  1088.      If the value of the flag is "on", the target will maintain the
  1089. (possibly partial) result set for subsequent Present requests.  If the
  1090. value of the flag is "off", the target may delete the result set.  A result
  1091. set status of "none" on the subsequent Search response indicates that the
  1092. target has discarded the result set.  In all cases, the values of
  1093. Search-status and Result-set-status in the Search response describe the
  1094. actual decisions made by the target system and the way in which the search
  1095. terminated.
  1096.  
  1097. 3.2.6.1.6    Reference-id  See section 3.4.  
  1098.  
  1099.  
  1100. 3.2.7  Termination Facility
  1101.            The Termination Facility allows either:
  1102.     (1)    an origin or target to initiate abrupt termination of the association via the IR-abort service
  1103.            element, or 
  1104.     (2)    an origin system to initiate graceful termination via the IR-release service.  
  1105.  
  1106.     Both the IR-abort and IR-release services map directly onto the A-ABORT
  1107. and A-RELEASE services of the association control service element.
  1108.  
  1109.  
  1110. 3.2.7.1  IR-abort Service 
  1111.     Either the origin or target may at any time either send or receive an
  1112. IR-abort request, and consider the application association terminated.
  1113.  
  1114. 3.2.7.2  IR-Release Service 
  1115.     The origin may invoke an IR-release request following receipt of an
  1116. Init, Search, Present, or Delete response.  It should then await receipt of
  1117. an IR-Release response, and then consider the association terminated.
  1118. Alternately, it might receive an IR-abort request from the target, in which
  1119. case it should consider the application association terminated.
  1120.  
  1121.     The target may receive an IR-release request after sending an Init,
  1122. Search, Present, or Delete response, or a Resource-control or
  1123. Access-control request. It should then send an IR-release response, and
  1124. consider the association terminated.
  1125.  
  1126. 3.3   MESSAGE SIZE  LIMITATIONS 
  1127.            
  1128.     For both the Search and Present services, it is possible that the
  1129. target will not be able to return the number of database records requested
  1130. because of message size limitations.  In that case, the target is
  1131. responsible for packing as many records as possible into the response
  1132. message.  (Note: A response message always contains an integral number of
  1133. records; a record never spans response messages.)
  1134.  
  1135. Illustration
  1136.     Assume that the target is attempting to transmit records in result set
  1137. positions 1 through 10 (in this section, the term "record" means "database
  1138. or surrogate diagnostic record", unless "diagnostic record" or "database
  1139. record" is specified).  Assume further that:
  1140.  
  1141.     o records in position 1 through 6 fit in the response message, such
  1142. that the sum of the sizes of the records (not including any protocol
  1143. control information) does not exceed Preferred-message-size; but,
  1144.     o the database record in position 7 will not fit in the message along
  1145. with records in position 1 through 6 without the resulting sum of the
  1146. message sizes exceeding Preferred-message-size.
  1147.            
  1148.  
  1149.     The size of the database record in position 7:
  1150.      (a)   does not exceed Preferred-message-size, or
  1151.      (b)   exceeds Preferred-message-size, but does not exceed
  1152. Maximum-record-size, or 
  1153.      (c)    exceeds Maximum-record-size.
  1154.     
  1155.     In case (a), the target returns records in position 1 through 6.       
  1156.  
  1157.     In case (b), except as noted below (see "Exception"), the target
  1158. substitutes a diagnostic record for the database record in position 7,
  1159. indicating that the record exceeds Preferred-message-size.  In case (c) the
  1160. target substitutes a diagnostic record for the database record in position
  1161. 7, indicating that the record exceeds Maximum-record-size.  (If
  1162. Maximum-record-size equals Preferred-message-size then there is no
  1163. distinction between the meaning of the two diagnostics.)
  1164.  
  1165.     In case (b) or (c) if the diagnostic record will not fit along with the
  1166. records in position 1 through 6, the target returns the records in position
  1167. 1 through 6.  (Preferred-message-size must always be large enough to
  1168. contain any diagnostic record; thus a subsequent present request beginning
  1169. with the record in position 7 will retrieve the diagnostic.)  Otherwise,
  1170. the target inserts the diagnostic record and proceeds to attempt to fit
  1171. records in positions 8 through 10 into the response message.
  1172.  
  1173. Exception
  1174.     If a Present request specifies a single record (i.e.
  1175. Number-of-records-requested equals 1) then if the size of that record
  1176. exceeds Preferred-message-size, but does not exceed Maximum-record-size,
  1177. the target will return that single database record in the Present response.
  1178. Note that this exception applies only to a Present request and not to a
  1179. Search request.
  1180.  
  1181.     Thus in case (b), the origin may subsequently request the database
  1182. record in position 7, by issuing a Present request in which that record is
  1183. the only record requested.
  1184.  
  1185.     Note that the purpose of this distinction between
  1186. Preferred-message-size and Maximum-record-size is to allow the transfer of
  1187. normal length records to proceed in a routine fashion, with convenient
  1188. buffer sizes, but to also provide for the transfer of an occasional
  1189. exceptionally large database record without requiring the origin to
  1190. continually allocate and hold local buffer space for worst-case records.
  1191. Note also that this intended purpose is defeated if the origin routinely
  1192. requests a single record.
  1193.  
  1194.  
  1195. 3.4  RERERENCE-ID
  1196.    The parameter Reference-id, is optional in an Init, Search, Present, and
  1197. Delete request.  If supplied,  
  1198.  
  1199.  
  1200.            -        it must be echoed by the target in the respective response,
  1201.            -        it must be echoed in both the request and response of any intermediate Access-
  1202.                     control or Resource-control request/response sequences. 
  1203.  
  1204.     If Reference-id is not supplied in an Init, Search, Present, or Delete
  1205. request, then it is not to appear in the respective response, nor in either
  1206. the request or response of any intermediate Access-control or
  1207. Resource-control request/response sequence.
  1208.  
  1209.     The service does not assume any relationship between the Reference-id
  1210. used in an Init, Search, Present, or Delete request and the Reference-id
  1211. used in any other Init, Search, Present, or Delete request.
  1212.  
  1213.     The purpose of this parameter is to facilitate the grouping of events
  1214. by the origin system. This standard does not specify its contents.
  1215. Reference-ids are always assigned by the origin and have meaning only
  1216. within the origin system.  Since there are no semantics attributed to this
  1217. parameter, it has no implied datatype and can only be described as
  1218. transparent binary data.  It is therefore described as ASN.1 type
  1219. OCTETSTRING).
  1220.  
  1221. 4.  PROTOCOL SPECIFICATION
  1222.  
  1223.     This version of the ANSI Z39.50-1991 Information Retrieval protocol is
  1224. version 2.  (Note: Version 2 is identical to version 1, and implementations
  1225. which support version 2 automatically support version 1.  Version 1 of ANSI
  1226. Z39.50-1991 should not be confused with ANSI Z39.50-1988).
  1227.  
  1228.     The Information Retrieval application protocol specifies the formats
  1229. and procedures governing the transfer of information between peer
  1230. information retrieval applications. A unit of information, passed between
  1231. two peer applications is called an "application protocol data unit" or
  1232. APDU.
  1233.  
  1234. 4.1  ABSTRACT SYNTAX OF THE INFORMATION RETRIEVAL PROTOCOL 
  1235.  
  1236.     The Information Retrieval protocol data units are complex data types.
  1237. The transfer syntax of these data types is negotiated by the presentation
  1238. service provider.  The definitions in this section specify the component
  1239. data elements of the protocol data units and the Type-0 , Type-1 Type-2,
  1240. and Type-100 queries.
  1241.  
  1242. 4.1.1  ASN.1 Specification of the APDUs
  1243.  
  1244.          This section describes the abstract syntax of the Z39.50 APDUs,
  1245. using the ASN.1 notation defined in ISO 8824 and in its addendum 1.  The
  1246. comments included within the ASN.1 specification constitute part of the
  1247. standard.
  1248.  
  1249. BEGIN   -- ANSI Z39.50 version 2 - May 16, 1991
  1250. ANSIZ39-50-2  DEFINITIONS ::=  
  1251. BEGIN         
  1252.  
  1253. PDU ::= CHOICE{
  1254.   initRequest                         [20]      IMPLICIT InitializeRequest,
  1255.   initResponse                        [21]      IMPLICIT InitializeResponse,
  1256.   searchRequest                       [22]      IMPLICIT SearchRequest,
  1257.   searchResponse                      [23]      IMPLICIT SearchResponse,
  1258.   presentRequest                      [24]      IMPLICIT PresentRequest,
  1259.   presentResponse                     [25]      IMPLICIT PresentResponse,
  1260.   deleteResultSetRequest              [26]      IMPLICIT DeleteResultSetRequest,
  1261.   deleteResultSetResponse             [27]      IMPLICIT DeleteResultSetResponse,
  1262.   accessControlRequest                [28]      IMPLICIT AccessControlRequest,
  1263.   accessControlResponse               [29]      IMPLICIT AccessControlResponse,
  1264.   resourceControlRequest              [30]      IMPLICIT ResourceControlRequest,
  1265.   resourceControlResponse             [31]      IMPLICIT ResourceControlResponse}
  1266.          -- new APDUs can be added in the future at the end of this list.
  1267.  
  1268. -- Initialization APDUs 
  1269.       InitializeRequest ::=SEQUENCE{
  1270.            referenceId                      ReferenceId OPTIONAL,
  1271.            protocolVersion                  ProtocolVersion,
  1272.                     -- proposed version of the protocol to be used (see below).
  1273.            options                          Options,
  1274.                     -- proposed set of services to be used                               
  1275.            preferredMessageSize             PreferredMessageSize,
  1276.                     -- origin proposal for the size of large messages
  1277. (where message size 
  1278. is the sum of sizes, in bytes, of the records in an APDU)
  1279. the target should normally use when presenting groups of records;
  1280. however, the first record in a response is permitted to cause the
  1281. message to exceed this size (see also maximumRecordSize below).
  1282.            maximumRecordSize                MaximumRecordSize,
  1283. origin proposal for maximum record size (number of bytes).
  1284. Value must be greater than or equal to preferredMessageSize.
  1285.            idAuthentication                 [7]  ANY OPTIONAL,
  1286. information as required by the target to access the responding
  1287. IRPM; syntax of this parameter to be defined by the target prior
  1288. to communication.
  1289.            implementationId                 ImplementationId OPTIONAL,
  1290.            implementationName               ImplementationName OPTIONAL,
  1291.            implementationVersion            ImplementationVersion OPTIONAL,
  1292.            userInformationField             UserInformationField OPTIONAL}
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  InitializeResponse ::= SEQUENCE
  1298.            {referenceId                     ReferenceId OPTIONAL,
  1299.            protocolVersion                  ProtocolVersion,
  1300.            options                          Options,
  1301.            preferredMessageSize             PreferredMessageSize,
  1302. target decision on maximum APDU size (see description under
  1303. InitializationRequest definition). Value is allowed to be different
  1304. from what origin proposed in the InitializationRequest; if origin
  1305. does not agree on target values, it may abort the connection.
  1306.            maximumRecordSize                MaximumRecordSize,
  1307. target decision on the maximum record size 
  1308.            result                           [12]  IMPLICIT BOOLEAN,
  1309. result of the processing of the request at the target. 
  1310. reject = FALSE. Accept = TRUE;
  1311.            implementationId                 ImplementationId OPTIONAL,
  1312.            implementationName               ImplementationName OPTIONAL,
  1313.            implementationVersion            ImplementationVersion OPTIONAL,
  1314.            userInformationField             UserInformationField OPTIONAL}
  1315. -- Auxiliary definitions for Initialization APDUs
  1316.       ProtocolVersion  ::=  [3]   IMPLICIT BIT STRING
  1317. represents a string of Boolean values, each value representing a
  1318. version. The first value set to 1 indicates version 1 is available,
  1319. the second value set to 1 indicates version 2 is available,
  1320. and so on.  Values higher than the highest known version should
  1321. be ignored.  Both the Initialize and Initialize Response APDUs
  1322. include a value string corresponding to the supported versions.
  1323. The highest common version is selected for use.  If there are no
  1324. versions in common, the Initialize Response APDU should
  1325. indicate a value of "reject" for the parameter Result.
  1326. Note: Versions 1 and 2 are identical. Systems supporting version
  1327. 2 should indicate support for version 1 as well, for interoperability
  1328. with systems that indicate support for version 1 only.  
  1329.       Options  ::=  [4]   IMPLICIT BIT STRING {search  (0), present (1), 
  1330.                                             delSet  (2), resourceCtrl (3), accessCtrl (4)}
  1331. In InitializeRequest, for search, present and delete, bit ON
  1332. indicates initiator does request use of service; for resource
  1333. contrl and access control, bit ON indicated indicates initiator
  1334. will support service. For InitializeResponse, for search, present
  1335. and delete, bit ON indicates target will support service; for
  1336. resource control and access control, bit ON indicated target
  1337. requests service.  For extensibility of the protocol, additional
  1338. bits set should not be considered to be an error on received
  1339. InitializeRequest.
  1340.       PreferredMessageSize                  ::=   [5]   IMPLICIT INTEGER
  1341.       MaximumRecordSize                     ::=   [6]   IMPLICIT INTEGER
  1342.       ImplementationId                      ::=  [110]   IMPLICIT VisibleString
  1343.       ImplementationName                    ::=  [111]   IMPLICIT VisibleString
  1344.       ImplementationVersion                 ::=  [112]   IMPLICIT VisibleString
  1345. these three implementation parameters are provided solely for the
  1346. convenience of implementors needing to distinguish implemen-
  1347. tations. They shall not be the subject of conformance tests.
  1348.       UserInformationField                  ::=  [11]   EXTERNAL 
  1349. additional information, not defined in this standard.
  1350. -- end auxiliary definitions for initialization APDUs
  1351.  
  1352. -- Search APDUs 
  1353.       SearchRequest ::= SEQUENCE{
  1354.            referenceId                      ReferenceId OPTIONAL,
  1355.            smallSetUpperBound               [13]  IMPLICIT INTEGER,
  1356. if the number of hits is less than or equal to this number, all
  1357. records are to be returned in the SearchResponse (within the 
  1358. limits given by the negotiated preferredMessage- and
  1359. maximumRecordSize), composed in the way specified by the
  1360. smallSetElementSetNames parameter below.  May be zero.
  1361.            largeSetLowerBound               [14]  IMPLICIT INTEGER,
  1362. if the number of hits is equal to or greater than this number, no
  1363. records are to be returned. LargeSetLowerBound must be greater
  1364. than smallSetUpperBound.  
  1365.            mediumSetPresentNumber  [15]  IMPLICIT INTEGER,
  1366. maximum no. of records to be returned in the SearchResponse
  1367. if the number of hits is between largeSetLowerBound and
  1368. smallSetUpperBound (again within the limits given
  1369. by the message and record size parameters), composed as 
  1370. specified by mediumSetRecordElementSetNames
  1371.            replaceIndicator                 [16]  IMPLICIT BOOLEAN,
  1372. origin indicates whether or not to replace a previously created
  1373. result set with the same name by the one that is constructed in
  1374. this search.
  1375.            resultSetName                    [17]  IMPLICIT VisibleString,
  1376. origin proposal for naming of the result set that is constructed
  1377. if hits are found. If target allows the origin to assign names to
  1378. result sets, it uses this proposed name.  If the target does
  1379. not support named result sets it returns an error diagnostic.
  1380.            databaseNames                    [18] IMPLICIT SEQUENCE OF DatabaseName,
  1381. database(s) in which the search will be performed.
  1382.            smallSetElementSetNames [100] IMPLICIT ElementSetNames OPTIONAL,
  1383. origin proposal for composition of the records in the small set
  1384. (see above under smallSetUpperBound).
  1385.            mediumSetElementSetNames [101] IMPLICIT ElementSetNames
  1386.                                                                   OPTIONAL,
  1387. origin proposal for the composition of the records in the medium
  1388. set (see above under mediumSetPresentNumber).
  1389.            preferredRecordSyntax            PreferredRecordSyntax OPTIONAL,
  1390. origin proposal for abstract syntax of the database records to
  1391. be returned in the SearchResponse. Values subject to registration.
  1392.            query    [21]                    Query}
  1393. the search argument (see description below).
  1394. -- query definition
  1395.       Query  ::=  CHOICE 
  1396.            {type-0                          [0]   ANY,  
  1397.             type-1                          [1]  IMPLICIT RPNQuery,
  1398.             type-2                          [2]  OCTET STRING,
  1399.             type-100                        [100] OCTET STRING}
  1400. the search argument contained in the SearchRequest.  Four types
  1401. are defined:
  1402.  
  1403.            --   a) A type-0 query may be used only when the origin and target
  1404.            --      have an a priori agreement outside of this standard as to 
  1405.            --      form of quert acceptable to the target.
  1406.            --   b) type-1 is the Reverse Polish Notation (RPN) query (see below).  
  1407.            --   c) type-2 is the ISO8777 type query, specified in ISO 8777.
  1408.            --   d) type-100 is the Z39.58 type query.
  1409.  
  1410.     RPNQuery  ::=  SEQUENCE{ 
  1411.                    attributeSetId  OBJECT IDENTIFIER,  -- identifies attribute set
  1412.                    RPNStructure}
  1413.  
  1414.          RPNStructure ::= CHOICE { 
  1415.                            [0] Operand, 
  1416.                            [1] IMPLICIT SEQUENCE { 
  1417.                                   RPNStructure, 
  1418.                                   RPNStructure, 
  1419.                                   Operator } } 
  1420.  
  1421.          Operand                      ::=  CHOICE{
  1422.                                       AttributesPlusTerm, 
  1423.                                       ResultSetId}
  1424.  
  1425.          AttributesPlusTerm           ::=  [102]   IMPLICIT SEQUENCE{
  1426.                                                           AttributeList, 
  1427.                                                           Term}
  1428.  
  1429.          AttributeList                ::=  [44]   IMPLICIT SEQUENCE OF
  1430.                                                           AttributeElement
  1431.    
  1432.     Term                     ::=  [45]   IMPLICIT OCTET STRING
  1433.                    -- the type OCTET STRING is used to enable the inclusion of
  1434.                    -- multibyte character representations which the types CharacterString
  1435.                    -- and VisibleString might impose on graphic character repertoire.
  1436.  
  1437.     Operator                 ::=  [46]   CHOICE{
  1438.                                       and                 [0] IMPLICIT NULL,
  1439.                                       or                  [1] IMPLICIT NULL,
  1440.                                       and-not             [2] IMPLICIT NULL}
  1441.  
  1442.    AttributeElement          ::=  SEQUENCE{
  1443.                                       AttributeType,
  1444.                                       AttributeValue}
  1445.  
  1446.    AttributeType  ::=  [120] IMPLICIT INTEGER
  1447.    AttributeValue ::=  [121] IMPLICIT INTEGER
  1448.                    -- AttributeType and AttributeValue interpretation is governed by the
  1449.                    -- values contained in the definition identified by AttributeSetId
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.   SearchResponse ::= SEQUENCE{
  1458.          referenceId                  ReferenceId OPTIONAL,
  1459.          resultCount                  [23]  IMPLICIT INTEGER,
  1460.                    -- number of hits resulting from the search.
  1461.          numberOfRecordsReturned NumberOfRecordsReturned,
  1462.                    -- number of records in the searchResults below.
  1463.          nextResultSetPosition   NextResultSetPosition,
  1464.                    -- the ordinal number in the result set of the record appearing
  1465.                    -- directly after the last record in the searchResults below.
  1466.          searchStatus                 [22]  IMPLICIT BOOLEAN,
  1467.                    -- result of the processing of the request at the target IRPM.
  1468.                    -- success = TRUE; failure = FALSE.
  1469.          resultSetStatus              [26]  IMPLICIT INTEGER
  1470.                                                 {subset(1), interim(2), none(3)} OPTIONAL,
  1471.                    -- occurs if and only if search-status is FALSE indicates the presence
  1472.                    -- and validity of the result set produced.
  1473.          presentStatus                PresentStatus OPTIONAL,
  1474.                    -- occurs if and only if search-status is TRUE. Indicates presence and
  1475.                    -- validity of records appearing in searchResults (see below).
  1476.          databaseOrDiagnosticRecords  Records OPTIONAL}
  1477.                    -- the records (diagnostic and/or bibliographic) resulting from the
  1478.                    -- search (see description below).
  1479.  
  1480. -- Present APDUs
  1481.     PresentRequest ::= SEQUENCE{
  1482.          referenceId                  ReferenceId OPTIONAL,
  1483.          resultSetId                  ResultSetId,
  1484.                    -- identification of the result set from which to retrieve records
  1485.          resultSetStartPoint          [30]      IMPLICIT INTEGER,
  1486.                    -- ordinal number in the result set of the first record to appear in
  1487.                    -- the presentResults in the PresentResponse.
  1488.          numberOfRecordsRequested [29]                    IMPLICIT INTEGER,
  1489.                    -- specifies the maximum number of records to be returned in the
  1490.                    -- presentResults in the PresentResponse (within the limits given by
  1491.                    -- the negotiated message and record size parameters), composed as 
  1492.                    -- specified by the element set names parameter below.
  1493.          ElementSetNames                        OPTIONAL,
  1494.                    -- origin proposal for the composition of the records to be returned
  1495.                    -- in the presentResults parameter in the PresentResponse 
  1496.          preferredRecordSyntax                  PreferredRecordSyntax OPTIONAL}
  1497.                    -- origin proposal for abstract syntax of the database records to
  1498.                    -- be returned in the presentResults in the PresentResponse.  Values
  1499.                    -- subject to registration, at present by specification in Appendix E.
  1500.  PresentResponse ::= SEQUENCE{
  1501.          referenceId                  ReferenceId OPTIONAL,
  1502.          numberOfRecordsReturned                NumberOfRecordsReturned,
  1503.                    -- number of records returned in the presentResults below.
  1504.          nextResultSetPosition        NextResultSetPosition,
  1505.                    -- the ordinal number in the result set of the record appearing
  1506.                    -- directly after the last record in the presentResults below.
  1507.          presentStatus                PresentStatus,
  1508.                    -- indicates the presence and validity of the records 
  1509.          databaseOrDiagnosticRecords Records OPTIONAL} -- the presented records
  1510. -- begin auxiliary definitions for search and present APDUs
  1511. -- begin definition of record structure
  1512.  
  1513. Records ::= CHOICE{
  1514.          dataBaseOrSurDiagnostics               [28] IMPLICIT SEQUENCE OF
  1515.                                                           NamePlusRecord,
  1516.          nonSurrogateDiagnostic                 [130] IMPLICIT  DiagRec}
  1517.  
  1518.          NamePlusRecord  ::=  SEQUENCE{
  1519.                    [0] IMPLICIT DatabaseName OPTIONAL,
  1520.          presence of DatabaseName is conditional. See
  1521.          3.2.2.1.5 and 3.2.3.1.5.
  1522.                    [1] CHOICE{   
  1523.                       databaseRecord                      [1] DatabaseRecord,
  1524.                       surrogateDiagnostic                 [2] DiagRec}}
  1525.  
  1526.          DatabaseRecord  ::=  EXTERNAL
  1527.                    -- the database record syntax is defined outside of this standard.
  1528.                    -- For bibliographic data, USMARC is a prime example.
  1529.  
  1530.          DiagRec  ::=  SEQUENCE{ 
  1531.              diagnosticSetId          OBJECT IDENTIFIER,
  1532.              condition                INTEGER,
  1533.                    -- interpretation of condition is governed by values contained in
  1534.                    -- definition identified by DiagnosticSetId.
  1535.              addinfo                  VisibleString} -- add'l information.
  1536. -- end definition of record structure
  1537.  
  1538. -- begin definition of element set names
  1539.       ElementSetNames                 ::=  [19]   CHOICE{
  1540.          generic                        [0] IMPLICIT ElementSetName,
  1541.          databaseSpecific               [1] IMPLICIT SEQUENCE OF SEQUENCE{
  1542.                                                           DatabaseName,
  1543.                                                           ElementSetName}}
  1544.       ElementSetName  ::=  [103]   IMPLICIT VisibleString
  1545.             -- A target must always recognize the value "F" to mean "full record". 
  1546.  
  1547. -- end definition of element set name.
  1548.  
  1549. -- begin miscellaneous definitions for search and present APDUs
  1550.   NumberOfRecordsReturned             ::=  [24]   IMPLICIT INTEGER
  1551.   NextResultSetPosition               ::=  [25]   IMPLICIT INTEGER 
  1552.   PresentStatus                       ::=  [27]   IMPLICIT INTEGER{
  1553.                                                 success (0),
  1554.                                                 partial-1 (1),
  1555.                                                 partial-2 (2),
  1556.                                                 partial-3 (3),
  1557.                                                 partial-4 (4),
  1558.                                                 failure   (5)}
  1559.   PreferredRecordSyntax               ::=  [104]   IMPLICIT OBJECT IDENTIFIER
  1560. -- end miscellaneous definitions for search and present APDUs
  1561. -- end auxiliary definitions for search and present APDUs
  1562.  
  1563. -- Delete Result Set APDUs 
  1564.  
  1565. DeleteResultSetRequest ::=SEQUENCE{
  1566.          referenceId                  ReferenceId OPTIONAL,
  1567.          deleteOperation              [32]      IMPLICIT INTEGER{
  1568.                                                 list (0),
  1569.                                                 all (1)},
  1570.          resultSetList                SEQUENCE OF ResultSetId OPTIONAL } 
  1571.                    -- identification of result sets to be deleted if operation is "list" 
  1572.  
  1573. DeleteResultSetResponse ::= SEQUENCE{
  1574.          referenceId                  ReferenceId OPTIONAL,
  1575.          deleteOperationStatus        [0]  IMPLICIT DeleteSetStatus,
  1576.                    -- Reports status for entire delete operation.  Values limited to
  1577.                    -- "success" or "failure-3" through "failure-9". Values of "failure-7"
  1578.                    -- and "failure-8" may be used  only if operation is "all".
  1579.          listStatuses                 [1]  IMPLICIT ListStatuses OPTIONAL,
  1580.                    -- Must occur if operation is "list".  Individual status values
  1581.                    -- limited to  "success" through "failure-6".
  1582.          numberNotDeleted             [34]      IMPLICIT INTEGER OPTIONAL,
  1583.                    -- number of result sets the target failed to delete.  Occurs only
  1584.                    -- if operation is "all".
  1585.          bulkStatuses        [35]     IMPLICIT ListStatuses OPTIONAL,
  1586.                    -- occurs if and only if DeleteSetStatus equals 8.  Individual
  1587.                    -- statuses limited to  "success" through "failure-6"
  1588.          deleteMessage       [36]     IMPLICIT VisibleString OPTIONAL}
  1589.                    -- textual message concerning the delete operation.
  1590.  
  1591. -- begin auxiliary definitions for delete
  1592. ListStatuses ::= SEQUENCE OF SEQUENCE{ 
  1593.                     ResultSetId, 
  1594.                     DeleteSetStatus}        
  1595.  
  1596. DeleteSetStatus ::= [33] IMPLICIT INTEGER{
  1597.                     success                                                              (0),
  1598.                     resultSetDidNotExist                                                 (1),
  1599.                     previouslyDeletedByTarget                                            (2),
  1600.                     systemProblemAtTarget                                                (3),
  1601.                     accessNotAllowed                                                     (4),
  1602.                     resource-control-at-origin                                           (5),
  1603.                     resourceControl-at-target                                            (6),
  1604.                     bulkDeleteNotSupported                                               (7),
  1605.                     notAllRsltSetsDeletedOnBulkDlte                                      (8),
  1606.                     notAllRequestedResultSetsDeleted                                     (9)}
  1607.                    -- 7 and 8 used only if operation is "all".
  1608. -- end auxiliary definitions for delete
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616. --  Access Control APDUs 
  1617.   AccessControlRequest ::= SEQUENCE{
  1618.            referenceId                      ReferenceId OPTIONAL,
  1619.            securityChallenge                [37] IMPLICIT OCTET STRING}
  1620.  
  1621.   AccessControlResponse ::= SEQUENCE{
  1622.            referenceId                      ReferenceId OPTIONAL,
  1623.            securityChallengeResponse  [38] IMPLICIT OCTET STRING}
  1624.  
  1625. -- Resource Control APDUs 
  1626.  ResourceControlRequest ::= SEQUENCE{
  1627.            referenceId                                            ReferenceId OPTIONAL,
  1628.            suspendedFlag                    [39] IMPLICIT BOOLEAN, -- true = suspended
  1629.            resourceReport                   [40] IMPLICIT ResourceReport OPTIONAL,
  1630.            partialResultsAvailable          [41] IMPLICIT INTEGER{
  1631.                                                                   subset  (1),
  1632.                                                                   interim (2),
  1633.                                                                   none  (3)} OPTIONAL,
  1634.  
  1635. ResourceControlResponse ::= SEQUENCE{
  1636.            referenceId                      ReferenceId OPTIONAL,
  1637.            continueFlag                     [42] IMPLICIT BOOLEAN, -- true = continue
  1638.            resultSetWanted                  [43] IMPLICIT BOOLEAN OPTIONAL}
  1639. "true" = "result set wanted", required during a search if
  1640. Continue flag is false; otherwise should not occur
  1641.  
  1642. -- Begin auxiliary definitions for access and resource control
  1643. ResourceReport ::= SEQUENCE{
  1644.            resourceReportId                 [1] IMPLICIT OBJECT IDENTIFIER,
  1645.            estimates                        [2] IMPLICIT SEQUENCE OF Estimate,
  1646.            message                          [3] IMPLICIT VisibleString}
  1647.  
  1648. Estimate ::= SEQUENCE
  1649.            {estimateType                    [1] IMPLICIT INTEGER,
  1650. from table, determined by ResourceReportId
  1651.            estimateValue                    [2] IMPLICIT INTEGER} 
  1652. the actual estimate
  1653. -- End auxiliary definitions for resource and access control
  1654.  
  1655. -- begin global auxiliary definitions
  1656. ReferenceId  ::=                            [2]   IMPLICIT OCTET STRING
  1657.            -- value provided by the service originator in the Request APDU, target
  1658.            -- required to send it back unaltered in corresponding response APDU
  1659.  
  1660. DatabaseName ::=                            [105]   IMPLICIT VisibleString
  1661. ResultSetId  ::=                            [31]   IMPLICIT VisibleString
  1662.  
  1663. -- end global auxiliary definitions
  1664. END -- ANSIZ39-50-2  
  1665. END.
  1666. 4.2 PROTOCOL PROCEDURES 
  1667. 4.2.1 Services Required
  1668. 4.2.1.1  Service Required from the Presentation Layer 
  1669.  
  1670.            The protocol uses the presentation service as defined in ISO
  1671. 8822 to provide a presentation connection for communication between two
  1672. information retrieval applications.  The presentation services required are
  1673. those contained in the presentation kernel functional unit and the session
  1674. duplex functional unit. The common application association control protocol
  1675. may have additional requirements for presentation services.
  1676.  
  1677.            All Information Retrieval protocol data units will be mapped
  1678. onto the P-Data service.  The communication service that supports this
  1679. protocol is a connection-oriented service using the P-DATA service, defined
  1680. in ISO 8822 in an established application association, in combination with
  1681. the ACSE, ISO 8649.
  1682.  
  1683.            A Z39.50 origin establishes application-associations as
  1684. necessary with the target with whom it is engaged in Z39.50 activity.  The
  1685. Z39.50 application-service-element (ASE) may then use the P- DATA service
  1686. defined in ISO 8822 directly to transmit Z39.50 APDUs.  This provides a
  1687. connection- oriented interaction between Z39.50 systems.  A single
  1688. application-association can be used to send a series of Z39.50 APDUs
  1689. relating to multiple searches.  A single system can be engaged in multiple
  1690. application associations with multiple remote systems simultaneously.
  1691.  
  1692.  
  1693. 4.2.1.2   Association Control Services Assumed 
  1694.  
  1695.            The protocol assumes the services of the association control
  1696. service elements as defined in ISO 8649.  The services required are:
  1697.  
  1698.             1)       orderly association release, where both sides agree to the release and there is no
  1699.                      loss of data in transit (the IR-release service is directly mapped to this service
  1700.                      without any Information Retrieval protocol control information), and
  1701.             2)       association abort, which allows either origin or target, at any time, to explicitly
  1702.                      terminate the association, immediately and unconditionally.  Data in transit may be
  1703.                      lost (the IR-abort service is directly mapped to this service without any Information
  1704.                      Retrieval protocol control information). 
  1705.  
  1706.            
  1707.  
  1708.            It is assumed that the Information Retrieval service user will
  1709. handle the association control services required to establish an
  1710. association with an application context encompassing the Information
  1711. Retrieval service.
  1712.  
  1713.  
  1714. 4.2.2  Protocol Model 
  1715.  
  1716.            To specify protocol procedure, the abstract,
  1717. implementation-independent concepts of service-user, service-provider, and
  1718. service primitive are used.
  1719.  
  1720.            A service-provider provides a communication path between two
  1721. service users.  A service primitive is an element of interraction between
  1722. the service-user and the service-provider.
  1723.  
  1724.  
  1725.             There are four types of service primitives: 
  1726.            1)        Request -  A primitive issued by the origin service-user to the service-provider in
  1727.                      order to invoke some procedure. 
  1728.            2)        Indication -  A primitive issued by the service-provider to the target service-user to
  1729.                      indicate that a procedure has been invoked by its peer.   
  1730.            3)        Response -  A primitive issued by the target service-user to the service-provider at
  1731.                      the completion of the procedure previously invoked by an  indication. 
  1732.            4)        Confirmation -  A primitive issued by the service-provider to the origin service-user
  1733.                      to complete the procedure previously invoked by a request. 
  1734.  
  1735.            Primitives are conceptual and their use neither specifies nor
  1736. precludes any specific implementation of a service.  Only primitives that
  1737. correspond to some element of the service involving the exchange of
  1738. information between systems are defined.
  1739.  
  1740.            From the perspective of the service-user, the service-provider
  1741. is system-independent. For the exchange of protocol however, a distinction
  1742. is made between those portions of the service-provider residing on the
  1743. origin and target systems (respectively, the origin service-provider and
  1744. the target service-provider). See figure 4.2.2-1. The sequence of
  1745. interractions is:
  1746.  
  1747. 1) Request Primitive from origin service-user to service-provider. 
  1748. 2) Protocol Message from origin service-provider to target service-provider. 
  1749. 3) Indication Primitive from service-provider to target service-user. 
  1750. 4) Response Primitive from target service-user to service-provider. 
  1751. 5) Protocol Message from target service-provider to origin service-provider. 
  1752. 6) Confirmation Primitive from service-provider to origin service-user. 
  1753.  
  1754. _____________________ Figure_____________________________________________________
  1755.  
  1756.        ORIGIN                              TARGET 
  1757.     SERVICE-USER                         SERVICE-USER 
  1758.              ^                               ^   ~
  1759.          3   3                               3   3 
  1760.          3   3                               3   3 
  1761.          3   36)Confirmation    3)Indication 3   3 
  1762.          3   3                               3   3 
  1763.          3   3                               3   3 
  1764.          3   3                               3   3 
  1765. 1)Request3   3                               3   34)Response
  1766.          3   3                               3   3
  1767.          3   3                               3   3 
  1768.          3   3                               3   3 
  1769.          3   3               2) Protocol     3   3
  1770.         \~/  ~                  Message      ~  \~/ 
  1771.         ORIGIN     ~DDDDDDDDDDDDDDDDDDDD>    TARGET 
  1772.   SERVICE-PROVIDER <~DDDDDDDDDDDDDDDDDDD~SERVICE-PROVIDER 
  1773.                     5) Protocol 
  1774.                        Message
  1775. _____________________________________________________________________
  1776.  
  1777.            The following illustrates the sequence of interactions which occur for a Search operation:
  1778. 1) Search request from origin service-user to service-provider. 
  1779. 2) Search APDU (Application Protocol Data Unit) from origin service-provider to target
  1780. service-provider. 
  1781. 3) Search indication from service-provider to target service-user. 
  1782. 4) Search response from target service-user to service-provider. 
  1783. 5) Search-response APDU from target service-provider to origin service- provider. 
  1784. 6) Search confirm from service-provider to origin service-user. 
  1785.  
  1786. NOTE: The interfaces between service user and service provider, as
  1787. represented by steps 1 and 6 for the origin, and by steps 3 and 4 for the
  1788. target, are described solely to facilitate the specification of protocols.
  1789. These steps do not represent intersystem communication, and therefore, the
  1790. means by which they are implemented are not constrained by this
  1791. specification.  In an actual implementation, step 4, for example, might
  1792. consist of several messages from the target service user to service
  1793. provider.  On the other hand, both the target service user and service
  1794. provider could be combined in a single program, in which case steps 3 and 4
  1795. might not have any real physical manifestation.
  1796.  
  1797. 4.2.3  State Tables
  1798.            This section defines two Information Retrieval Protocol Machines
  1799. (IRPMs) in terms of state tables. One state table is defined for the origin
  1800. (table 4-4) and one state table is defined for the target (table 4-5).
  1801. Each state table shows the inter-relationship between the state of an
  1802. Information Retrieval association, the incoming events that occur in the
  1803. protocol, the actions taken, and, finally, the resulting state of the
  1804. association.  The IRPM state table does not constitute a formal definition
  1805. of the IRPM.  It is included to provide a more precise specification of the
  1806. protocol procedures.  The following conventions are used in the state
  1807. tables.
  1808.  
  1809. State Table Cells The intersection of an incoming event (row) and a state
  1810. (column) forms a cell.  A blank cell represents the combination of an
  1811. incoming event and a state that is not defined for the IRPM.  A non blank
  1812. cell represents an incoming event and state that is defined for the IRPM.
  1813. Such a cell contains one or more actions, separated by semi-colons (;).
  1814.  
  1815. Actions to be Taken by the IRPM The IRPM state tables define the action to
  1816. be taken by the IRPM in terms of one or more outgoing events (separated by
  1817. semi-colons) and the resulting state (in parenthesis) of the Information
  1818. Retrieval association.
  1819.  
  1820. Invalid Intersections Blank cells indicate an invalid intersection of an
  1821. incoming event and state.  The state tables define correct operation only.
  1822. They do not specify actions to be taken in response to incorrect operation
  1823. (for example, erroneous protocol control information, incorrect protocol
  1824. control actions, etc).  Such actions are not within the scope of the
  1825. specification, although implementations must consider them.
  1826.  
  1827. Table 20: Events and Actions
  1828.     The following tables list the events and actions which occur in the
  1829. state tables and their abbreviations as used in the state tables.
  1830.   
  1831. Incoming Events -- Origin                                     Abbreviation
  1832. Init request                                                  Init req 
  1833. Init-response PDU                                             Init resp PDU
  1834. Search request                                                Srch req   
  1835. Search-response PDU                                           Srch resp PDU
  1836. Present request                                               Prsnt req  
  1837. Present-response PDU                                          Prsnt resp PDU
  1838. Delete request                                                Dlte req  
  1839. Delete-response PDU                                           Dlte resp PDU
  1840. Resource-control PDU                                          Rsc PDU
  1841. Resource-control response                                     Rsc resp   
  1842. Access-control PDU                                            Acc PDU
  1843. Access-control response                                       Acc resp     
  1844. P-P-abort indication                                          Pab ind
  1845. IR-abort request                                              Iab req
  1846. IR-release request                                            Irel req
  1847. A-release confirm                                             Arel conf
  1848. Outgoing Actions -- Origin                                    Abbreviation
  1849. Init PDU                                                      Init PDU
  1850. Init confirm                                                  Init conf
  1851. Search PDU                                                    Srch PDU
  1852. Search confirm                                                Srch conf
  1853. Present PDU                                                   Prsnt PDU
  1854. Present confirm                                               Prsnt conf
  1855. Delete PDU                                                    Dlte PDU
  1856. Delete confirm                                                Dlte conf
  1857. Resource-control indication                                   Rsc ind
  1858. Resource-control-response PDU                                 Rsc resp PDU
  1859. Access-control indication                                     Acc ind
  1860. Access-control-response PDU                                   Acc resp PDU
  1861. IR-abort indication                                           Iab ind
  1862. A-abort request                                               Aab req
  1863. A-release request                                             Arel req 
  1864. IR-release confirm                                            Irel conf
  1865. Save current state                                            stkst
  1866. Restore previously saved state                                popst                            
  1867.  
  1868. Incoming Event -- Target                                      Abbreviation
  1869. Init PDU                                                      Init PDU
  1870. Init response                                                 Init resp
  1871. Search PDU                                                    Srch PDU
  1872. Search response                                               Srch resp
  1873. Present PDU                                                   Prsnt PDU
  1874. Present response                                              Prsnt resp
  1875. Delete PDU                                                    Dlte PDU
  1876. Delete response                                               Dlte resp
  1877. Resource-control request                                      Rsc req   
  1878. Resource-control-response PDU                                 Rsc resp PDU
  1879. Access-control request                                        Acc req   
  1880. Access-control-response PDU                                   Acc resp PDU
  1881. A-P-abort indication                                          Apab ind
  1882. A-abort indication                                            Aab ind
  1883. IR-abort request                                              Iab req
  1884. A-release indication                                          Arel ind 
  1885. IR-release response                                           Irel resp
  1886.  
  1887. Outgoing Action -- Target                                     Abbreviation
  1888. Init indication                                               Init ind
  1889. Init-response PDU                                             Init resp PDU
  1890. Search indication                                             Srch ind
  1891. Search-response PDU                                           Srch resp PDU
  1892. Present indication                                            Prsnt ind
  1893. Present-response PDU                                          Prsnt resp PDU
  1894. Delete indication                                             Dlte ind
  1895. Delete-response PDU                                           Dlte resp PDU
  1896. Resource-control PDU                                          Rsc PDU
  1897. Resource-control confirm                                      Rsc conf
  1898. Access-control PDU                                            Acc PDU
  1899. Access-control confirm                                        Acc conf
  1900. IR-abort indication                                           Iab ind
  1901. Outgoing Action -- Target (continued)                         Abbreviation
  1902. A-abort request                                               Aab req
  1903. IR-release indication                                         Irel ind
  1904. A-release response                                            Arel resp
  1905. Save current state                                            stkst
  1906. Restore previously saved state                                popst
  1907.  
  1908. Table 21: Definition of States 
  1909.  
  1910. Origin states
  1911. 1. Closed: the origin is awaiting an Init request from the application
  1912. 2. Init sent: the origin has transmitted an Init APDU to the target
  1913. 3. Open: the origin is awaiting a Search, Present, or Delete request
  1914. 4. Search sent: the origin has transmitted a Search APDU
  1915. 5. Prsnt sent: the origin has transmitted a Present APDU
  1916. 6. Delete sent: the origin has transmitted a Delete APDU
  1917. 7. Rsctrl recvd: the origin has issued a Resource-control indication
  1918. 8. Acctrl recvd: the origin has issued an Access-control indication
  1919. 9. Rlease sent: the origin has issued an A_release request
  1920.  
  1921. Target states
  1922. 1.  Closed: the target is awaiting an Init APDU
  1923. 2.  Init recvd: the target has issued an Init indication
  1924. 3.  Open: the target is awaiting a Search, Present, or Delete APDU
  1925. 4.  Search recvd: the target has issued a Search indication
  1926. 5.  Prsnt recvd: the target has issued a Present indication
  1927. 6.  Delete recvd: the target has issued a Delete indication
  1928. 7.  Rsctrl sent: the target has transmitted a Resource-control APDU
  1929. 8.  Acctrl sent: the target has transmitted an Access-control APDU
  1930. 9.  Rlease Recvd: the target has issued an IR_rel indication.
  1931. 10. Reject: the target has transmitted an Init Response APDU (REJECT)
  1932.  
  1933. Table 22:  State Table for Origin Systems
  1934.  
  1935. STATE
  1936.  
  1937.    EVENT closed  
  1938.    1  Init
  1939.  sent
  1940.    2  Open
  1941.  
  1942.    3 Search
  1943.  sent
  1944.    4 Prsnt 
  1945. sent
  1946.   5 Delete
  1947. sent
  1948.   6 Rsctrl
  1949. recvd
  1950.   7 Acctrl
  1951. Recvd
  1952.   8 Rlease
  1953. sent
  1954.   9 Init
  1955. req Init PDU
  1956. (2) Init resp
  1957. PDU (ACCEPT) Init conf+
  1958. (3) Init resp
  1959. PDU
  1960. (REJECT) Init conf-
  1961. ;Arel req 
  1962. [(9) Srch
  1963. req Srch
  1964. PDU (4) Srch resp PDU Srch
  1965. conf (3)                                                                                                                    
  1966.  
  1967. Table 22 (continued):  State Table for Origin Systems
  1968. STATE
  1969.   EVENT Closed
  1970.   1 Init
  1971. sent
  1972.   2 Open Search
  1973. sent
  1974.   4 Prsnt
  1975. sent
  1976.   5 Delete
  1977. sent
  1978.   6 Rsctrl
  1979. recvd
  1980.   7 Acctrl
  1981. recvd
  1982.   8 Rlease
  1983. sent
  1984.   9 Prsnt req Prsnt
  1985. PDU
  1986. (5) Prsnt resp
  1987. PDU Prsnt
  1988. conf (3) Dlte req Dlte
  1989. PDU
  1990. (6) Dlte resp
  1991. PDU Dlte
  1992. conf (3) Rsc PDU Rsc
  1993. ind;
  1994. stkst
  1995. (7) Rsc ind;
  1996. stkst (7) Rsc ind;
  1997. stkst (7) Rsc ind;
  1998. stkst (7) Rsc resp Rsc
  1999. resp
  2000. PDU;
  2001. popst Acc PDU Acc
  2002. ind;
  2003. stkst
  2004. (8) Acc ind;
  2005. stkst (8) Acc ind;
  2006. stkst (8) Acc ind;
  2007. stkst (8) Acc resp Acc
  2008. resp
  2009. PDU;
  2010. popst  Aab ind Iab ind
  2011. (1) Iab
  2012. ind (1) Iab ind
  2013. (1) Iab ind
  2014. (1) Iab ind
  2015. (1) Iab ind
  2016. (1) Iab ind
  2017. (1) Iab ind
  2018. (1) Apab ind Iab ind
  2019. (1) Iab
  2020. ind (1) Iab ind
  2021. (1) Iab ind
  2022. (1) Iab ind
  2023. (1) Iab ind
  2024. (1) Iab ind
  2025. (1) Iab ind
  2026. (1) Iab req Aab
  2027. req (1) Aab
  2028. req (1) Aab req
  2029. (1) Aab req
  2030. (1) Aab req
  2031. (1) Aab
  2032. req (1) Aab
  2033. req (1) Aab req
  2034. (1) Irel req Arel
  2035. req (9) Arel conf Irel conf
  2036. (1) Table 23:  State Table for Target Systems
  2037.                                                                                                                                                                      
  2038.                                                                                                                                                            
  2039.  \ State
  2040.    \
  2041. Event\ Closed  Init
  2042. recvd
  2043.   2 Open
  2044.  
  2045.   3 Search
  2046.  recvd
  2047.    4 Prsnt
  2048. recvd
  2049.   5 Delete
  2050. recvd
  2051.   6 Rsctrl
  2052.  sent
  2053.   7 Acctrl
  2054.  sent
  2055.   8 Rlease
  2056. recvd
  2057.   9 Reject
  2058.   
  2059.   10 Init
  2060. PDU Init
  2061. ind
  2062. (2) Init
  2063. resp
  2064. (ACCEPT) Init
  2065. resp
  2066. PDU(+) 
  2067.  (3) Init 
  2068. resp
  2069. (REJECT) Init
  2070. resp
  2071. PDU(-)
  2072.  (10) Srch
  2073. PDU Srch
  2074. ind
  2075. (4) Srch
  2076. resp Srch
  2077. resp
  2078. PDU
  2079. (3) Prsnt
  2080. PDU  Prsnt
  2081. ind
  2082. (5) Prsnt
  2083. resp Prsnt
  2084. resp
  2085. PDU
  2086. (3) Dlte
  2087. PDU Dlte
  2088. ind
  2089. (6) Dlte
  2090. resp Dlte
  2091. resp
  2092. PDU
  2093. (3) Rsc
  2094. req Rsc
  2095. PDU;
  2096. stkst
  2097. (7) Rsc
  2098. PDU;
  2099. stkst
  2100. (7) Rsc
  2101. PDU;
  2102. stkst
  2103. (7) Rsc
  2104. PDU;
  2105. stkst
  2106. (7) Table 23 Continued
  2107.                                                                                              
  2108.  \
  2109. State
  2110.    \
  2111. Event\ Closed  Init
  2112. recvd
  2113.   2 Open
  2114.  
  2115.   3 Search
  2116.  recvd
  2117.    4 Prsnt
  2118. recvd
  2119.   5 Delete
  2120. recvd
  2121.   6 Rsctrl
  2122.  sent
  2123.   7 Acctrl
  2124.  sent
  2125.   8 Rlease
  2126. recvd
  2127.   9 Reject
  2128.  
  2129.   10 Rsc
  2130. resp
  2131. PDU Rsc
  2132. conf;
  2133. popst Acc
  2134. req Acc
  2135. PDU;
  2136. stkst
  2137. (8) Acc
  2138. PDU;
  2139. stkst
  2140. (8) Acc
  2141. PDU;
  2142. stkst
  2143. (8) Acc
  2144. PDU;
  2145. stkst
  2146. (8) Acc
  2147. resp
  2148. PDU Acc
  2149. conf;
  2150. popst Aab
  2151. ind Iab
  2152. ind
  2153. (1) Iab
  2154. ind
  2155. (1) Iab
  2156. ind
  2157. (1) Iab
  2158. ind
  2159. (1) Iab
  2160. ind
  2161. (1) Iab
  2162. ind
  2163. (1) Iab
  2164. ind
  2165. (1) Iab
  2166. ind
  2167. (1) Iab
  2168. ind
  2169. (1) Apab
  2170. ind Iab
  2171. ind
  2172. (1) Iab
  2173. ind
  2174. (1) Iab
  2175. ind
  2176. (1) Iab
  2177. ind
  2178. (1) Iab
  2179. ind
  2180. (1) Iab
  2181. ind
  2182. (1) Iab
  2183. ind
  2184. (1) Iab
  2185. ind
  2186. (1) Iab
  2187. ind
  2188. (1) Iab
  2189. req Aab
  2190. req
  2191. (1) Aab
  2192. req
  2193. (1) Aab
  2194. req
  2195. (1) Aab
  2196. req
  2197. (1) Aab
  2198. req
  2199. (1) Aab
  2200. req
  2201. (1) Aab
  2202. req
  2203. (1) Aab
  2204. req
  2205. (1) Aab
  2206. req
  2207. (1) Arel
  2208. ind Irel
  2209. ind
  2210. (9) Irel
  2211. ind
  2212. (9) Irel
  2213. resp Arel
  2214. resp
  2215. (1)
  2216. 4.2.4 Protocol Errors
  2217.     Any events not listed in the tables of section 4.2.3 are not valid and
  2218. are considered to be protocol errors.  With exceptions specified in section
  2219. 4.3, incorrectly formatted APDU's or APDU's with invalid data are also
  2220. considered to be protocol errors.  This standard does not specify the
  2221. actions to be taken upon detection of protocol errors.  [An application
  2222. context may contain such a specification.
  2223.  
  2224. 4.3 RULES FOR EXTENSIBILITY
  2225.     All syntactical errors in received APDUs are considered to be protocol
  2226. errors except for the following case: Unknown data elements, and unknown
  2227. options within the Options data element, will be ignored on received Init
  2228. APDUs.
  2229.  
  2230. 4.4  CONFORMANCE
  2231.     A system claiming to implement the procedures in this standard shall
  2232. comply with the requirements in sections 4.4.1, 4.4.2, and 4.4.3.
  2233.  
  2234.  
  2235. 4.4.1   Static Requirements
  2236. The system shall:
  2237.  
  2238.      a)    act in the role of an origin (by sending Init, Search, and Present APDUs and recieving Init-
  2239.            response, Search-response and Present- response APDUs), or target (by responding properly
  2240.            to Init, Search, and Present APDUs with appropriate Init-response, Search-response and
  2241.            Present-response APDUs), or both; and,
  2242.      b)    support the syntax in section 4.1, and
  2243.      c)    support the Type-1 Query.
  2244.  
  2245.  
  2246. 4.4.2   Dynamic Requirements
  2247.  
  2248. The system shall exhibit external behavior consistent with having implemented:
  2249.  
  2250.      a)    an Information Retrieval ASE which follows all the procedures specified in sections 4.1.1,
  2251.            4.2, and 4.3; 
  2252.      b)    the mapping onto the Association Control Service and Presentation Service (see 4.2.1); and
  2253.      c)    assignment of values to APDU data elements according to the procedures describes in
  2254.            section 3.
  2255.      d)    encoding of APDUs by applying the ASN.1 Basic Encoding Rules (ISO 8825) to the abstract
  2256.            syntax defined in section 4.1.1.
  2257.      e)    the type-1 query whose abstract syntax is defined in section 4.1.1 and whose structure is and
  2258.            rules for evaluation are described in the comments within section 4.1.1.
  2259.  
  2260.  
  2261. 4.4.3   Statement Requirements
  2262.  
  2263. 1. The following shall be stated by the implementer:
  2264.  
  2265.      a)    whether the system is capable of acting in the role of origin, 
  2266.      b)    whether the system is capable of acting in the role of target, 
  2267.      c)    that the system supports  [versions 1 and 2 of  [the Z39.50-1991 protocol.
  2268.  
  2269.  
  2270. 2. If the system claims capability of acting in the role of origin the implementor shall state whether
  2271. the system:
  2272.  
  2273.      a)    accepts Access-control APDUs and sends Access-control-response APDUs,
  2274.      b)    accepts Resource-control APDUs and sends Resource-control-response APDUs,
  2275.      c)    sends Delete APDUs and accepts Delete-response APDUs,
  2276.      d)    sends Search and Present APDUs specifying named result sets other than "default".
  2277.  
  2278. 3.  If the system claims capability of acting in the role of target, the implementor shall state whether
  2279. the system:
  2280.  
  2281.      a)    sends Access-control APDUs and accepts Access-control-response APDUs,
  2282.      b)    sends Resource-control APDUs and accepts Resource-control-response APDUs,
  2283.      c)    accepts Delete APDUs and sends Delete-response APDUs,
  2284.      d)    accepts Search and Present APDUs specifying named result sets other than "default",
  2285.      e)    unilaterally deletes result sets.
  2286.  
  2287. 4. The implementor shall state to what extent result sets may be specified as operands in a type-1
  2288. query:
  2289.  
  2290.      a)    whether named result sets in general, or only the default result set, may be used as an
  2291.            operand in a Type-1 query, 
  2292.      b)    whether result sets may be specified only as the first operand in a Type-1 query, or that they
  2293.            may be specified as any operand,
  2294.      c)    with which operators (AND, OR, AND-NOT) may result sets be used as operands.
  2295.  
  2296.  
  2297. 5.  The implementor shall state to what extent element set names are supported in Search and Present
  2298. APDUs:
  2299.  
  2300.      a)    whether the parameter Element-set-names is supported,
  2301.      b)    if the parameter element-set-names is supported, whether database names corresponding to
  2302.            element set names may be specified, or only a single element set name and no
  2303.            corresponding database name may be specified.
  2304.  
  2305.  
  2306. 6.  The implementor shall state: 
  2307.      a)    for each optional parameter in each APDU, whether or not the parameter is supported;
  2308.      
  2309.      f)    which encoding rules are supported;
  2310.      a)    the maximum number of database names which may be specified in a Search APDU;
  2311.      e)    which attribute sets are supported.
  2312.  
  2313.  
  2314. APPENDIX A: Object Identifiers Assigned in This Standard 
  2315.  
  2316.     This appendix is part of the standard. 
  2317.  
  2318.     The following object identifier value has been assigned to this standard, ANSI-standard-Z39.50:
  2319.         { iso (1) member-body (2) US (840) ANSI-standard-Z39.50 (10003)}
  2320.  
  2321.     This standard assigns the following values at the level immediately subordinate to
  2322. ANSI-standardZ39.50:
  2323.         1 = application context
  2324.         2 = abstract syntax
  2325.         3 = attribute set
  2326.         4 = diagnostic set
  2327.         5 = record syntax
  2328.         6 = resource report format
  2329.  
  2330. A.1 Application Context
  2331.     This standard assigns the following object identifier for the
  2332. application-context-definition 'basic-Z39.50-ac', contained in Appendix B:
  2333.  
  2334. { iso member-body US ANSI-standard-Z39.50  application-context (1) basic-Z39.50-ac (1) }
  2335.  
  2336. A.2 Abstract Syntax
  2337.     This standard assigns the following object identifier for the  ASN.1 module, contained in section
  2338. 4.1, defining the Z39.50 APDUs:
  2339.  
  2340. { iso member-body US ANSI-standard-Z39.50  abstract-syntax (2) Z39.50-apdus (1) }
  2341.  
  2342. Note: No object identifier is assigned by this standard for any transfer
  2343. syntax for apdus.  The transfer syntax results from the application of the
  2344. ASN.1 Basic Encoding Rules (ISO 8825). For the purposes of Presentation
  2345. Context negotiation, this syntax is identified by a pair of object
  2346. identifiers, one for the abstract-syntax (Z39.50-apdus) and one for the
  2347. basic encoding rules:
  2348.         { joint-iso-ccitt asn1 (1) basic-encoding (1) }
  2349.  
  2350. A.3 Attribute set
  2351.     This standard assigns the following object identifier for the
  2352. attribute-set definition 'bib-1', contained in Appendix C:
  2353.  
  2354. { iso member-body US ANSI-standard-Z39.50  attribute-set (3) bib-1 (1) }
  2355.  
  2356. A.4 Diagnostic Set
  2357.     This standard assigns the following object identifier for the
  2358. diagnostic set definition contained in appendix D.
  2359.  
  2360. { iso member-body US ANSI-standard-Z39.50  diagnostic-set (4) bib-1 (1)}
  2361.  
  2362. A.5  Record Syntax
  2363.     Object identifier for Record syntaxes are contained in appendix E.
  2364.  
  2365. A.6 Resource Report Format
  2366.     This standard assigns the following object identifier for the resource report format defined in
  2367. appendix F.
  2368. { iso member-body US ANSI-standard-Z39.50  resource-report-format (6) bib-1 (1)} APPENDIX B: Definition of Application Context basic-Z39.50-ac
  2369.  
  2370.     This appendix is part of the standard. 
  2371.  
  2372.     This appendix defines the application context basic-Z39.50-ac.  The
  2373. object identifier for application context basic-Z39.50-ac is defined and
  2374. registered in Appendix A.
  2375.  
  2376.  
  2377. Definition of application context basic-Z39.50-ac
  2378.  
  2379. ANSI-standard-Z39.50 application context basic-Z39.50-ac, supports an
  2380. application-entity that contains only the following two application service
  2381. elements (ASEs):
  2382.  
  2383.     a) the Association Control service element (ACSE, ISO 8650), and
  2384.     b) the Z39.50 service element.
  2385.  
  2386. [Z30.50 and ACSE are used according to the procedures in section 4.2.1.
  2387.  
  2388. The P-Data service is used to transmit Z39.50 APDUs.
  2389.  
  2390. In the event of protocol errors, the system detecting the error shall abort
  2391. the association.
  2392.  
  2393. APPENDIX C:  Attribute Set bib-1
  2394.  
  2395.          This appendix is part of the standard.  
  2396.  
  2397.          This Appendix defines the attribute-set bib-1. [Attribute-set
  2398. bib-1 is intended for use with bibliographic databases.  The object
  2399. identifier for attribute set bib-1 is defined and registered in Appendix A.
  2400.  
  2401.          When the value of AttributeSetId (within the RPNDefinition within
  2402. the Search APDU) equals the object identifier for this attribute-set, then:
  2403.  
  2404.      a) AttributeType (within AttributeElement within AttributeList) takes
  2405. values from the Attribute type table below, and
  2406.  
  2407.      b)  AttributeValue takes values from the corresponding value table.
  2408.  
  2409. Attribute-Type Values 
  2410.  
  2411. Attribute-type               Value
  2412. Use                          1
  2413. Relation                     2
  2414. Position                     3
  2415. Structure                    4
  2416. Truncation                   5
  2417. Completeness                 6
  2418.  
  2419. USE Values                         
  2420.     
  2421. Use                                   Value               Use                                   Value     
  2422. Personal-name                         1                   MESH-subject                          25
  2423. Corporate-name                        2                   PA-subject                            26
  2424. Conference-name                       3                   LC-subject-heading                    27
  2425. Title                                 4                   RVM-subject-heading                   28
  2426. Title-series                          5                   Local-subject-index                   29
  2427. Title-uniform                         6                   Date                                  30
  2428. ISBN                                  7                   Date-of-publication                   31
  2429. ISSN                                  8                   Date-of-acquisition                   32
  2430. LC-card-number                        9                   Title-key                             33
  2431. BNB-card-number                       10                  Title-collective                      34
  2432. BGF-number                            11                  Title-parallel                        35
  2433. Local-number                          12                  Title-cover                           36
  2434. Dewey-classification                  13                  Title-added-title-page                37
  2435. UDC-classification                    14                  Title-caption                         38
  2436. Bliss-classification                  15                  Title-running                         39
  2437. LC-call-number                        16                  Title-spine                           40
  2438. NLM-call-number                       17                  Title-other-variant                   41
  2439. NAL-call-number                       18                  Title-former                          42
  2440. MOS-call-number                       19                  Title-abbreviated                     43
  2441.  Local-classification                 20                  Title-expanded                        44
  2442. Subject-heading                       21                  Subject-precis                        45
  2443. Subject-Rameau                        22                  Subject-rswk                          46
  2444. BDI-index-subject                     23                  Subject-subdivision                   47
  2445. INSPEC-subject                        24                  Number-natl-bibliography              48
  2446.  
  2447. Number-legal-deposit                  49                  Name-and-title                        57
  2448. Number-govt-publication               50                  Name-geographic                       58
  2449. Number-publisher-for-music            51                  Place-publication                     59
  2450. Number-db                             52                  CODEN                                 60
  2451. Number-local-call                     53                  Microform-generation                  61
  2452. Code-language                         54                  [Abstract                             62
  2453. Code-geographic-area                  55                  [Note                                 63
  2454. Code-institution                      56
  2455.  
  2456. Author-title                          1000                [Author                               1007
  2457. NUC-code                              1001                [Author-name-personal                 1008
  2458. Combination-of-use                    1002                Author-name-corporation               1009
  2459. System-control-number                 1003                Author-name-conference                1010
  2460. Subject-classification                1004                Identifier-standard                   1011
  2461. Record-type                           1005                Subject-LC-children's        1012
  2462. Name                                  1006                Subject-name-personal        1013
  2463.  
  2464.  
  2465. Relation Values 
  2466.  
  2467. Relation                              Value               
  2468. equal                                 3
  2469. greater than                          5
  2470. greater or equal                      4
  2471. less than                             1
  2472. less than or equal                    2
  2473. not equal                             6
  2474.  
  2475.  
  2476. Position Values                                                    Structure Values 
  2477.  
  2478. Position                                        Value              Structure                                        Value 
  2479. first in field                                  1                  phrase                                           1 
  2480. first in subfield                               2                  word                                             2 
  2481.                                       key                                              3
  2482.                                                 year                                            4
  2483. any position in field                           3                  date                                             5
  2484.                                                                    word list                                        6
  2485.  
  2486. Truncation Values                               Completeness Values 
  2487.  
  2488. Truncation                                      Value              Completeness                                     Value
  2489. do not truncation                               100                incomplete subfield                              1
  2490. right truncation                                1                  complete subfield                                2
  2491. left truncation                                 2                  complete field                                   3
  2492. left and right                                  3
  2493. process # in search arg                         101 APPENDIX D: Diagnostic Set bib-1  (This appendix is part of the Standard.)
  2494.          This Appendix defines the diagnostic set bib-1.  The object
  2495. identifier for diagnostic set bib-1 is defined and registered in Appendix
  2496. A.  When the value of DiagnosticSetId (within DiagRec within the auxiliary
  2497. definitions for Search Response and Present Response APDUs) equals the
  2498. object identifier for this diagnostic set, then "condition" (within
  2499. DiagRec) takes values from the "Condition" column in the table below.
  2500.  
  2501. CONDITION   MEANING                    TYPE   
  2502. 1    Permanent system error                (1) 
  2503. 2     Temporary system error                         (1) 
  2504. 3    Unsupported search                   (2)
  2505. 4    Terms only exclusion (stop) words        (2) 
  2506. 5    Too many argument words                (2) 
  2507. 6    Too many boolean operators            (2) 
  2508. 7    Too many truncated words            (2) 
  2509. 8    Too many incomplete subfields            (2) 
  2510. 9    Truncated words too short            (2) 
  2511. 10    Invalid format for rec no (search term)        (2) 
  2512. 11    Too many characters in search statement        (2) 
  2513. 12    Too many records retrieved            (2) 
  2514. 13    Present request out-of-range (see note)        (3)
  2515. 14    System error in presenting records        (4) 
  2516. 15    Record not authorized to be sent intersystem    (4) 
  2517. 16    Record exceeds Preferred-message-size        (4) 
  2518. 17    Record exceeds Maximum-record-size        (4)
  2519. 18    Result set not supported as a search term    (2)
  2520. 19    only single rslt set as srch trm supported    (2)
  2521. 20    only ANDing of a single result set as  search term supported    (2)
  2522. 21    result set exists and replace indicator off    (2)
  2523. 22    result set naming not supported            (2)
  2524. 23    combination of specified databases not supported(2)
  2525. 24    Element set names not supported            (1)
  2526. 25    Specified element set name not valid for specified database    (1)
  2527. 26    only a single element set name supported    (1)
  2528. 27    Result set no longer exists - unilaterally deleted by target    (1)
  2529. 28    Result set is in use                (1)
  2530. 29    One of the specified databases is locked    (1)
  2531. 30    Specified result set does not exist        (1)
  2532. 31    Resources exhausted - no results available    (2)
  2533. 32    Resources exhausted - unpredictable partial results available    (2)
  2534. 33    Resources exhausted - valid subset of results available    (2)
  2535. 100    Access-control failure                (1)
  2536. 101      Security challenge required but could not be issued - request
  2537. terminated                         (1)
  2538. 102      Security challenge required but could not be issued - record
  2539. not included                        (4)
  2540. 103      Security challenge failed - record not included  (4)
  2541. 104      Terminated by negative continue response    (1)
  2542. TYPES:             (1)       May occur when search-status or present-status
  2543.                  = "failure". 
  2544.                    (2)       May occur only when search-status = "failure". 
  2545.                    (3)       May occur only when present-status = "failure". 
  2546.                    (4) May occur only as a surrogate for a database record.
  2547. NOTE: Condition 13 (present request out-of-range) applies when a present
  2548. request is partially or wholly out-of-range, and includes the case when
  2549. result-count is zero, but does not include the case where the specified
  2550. result set does not exist.
  2551.  
  2552. APPENDIX E: Record Syntaxes
  2553.  
  2554.          This appendix is part of the Standard.  
  2555.  
  2556.  
  2557.          This appendix defines and registers object identifiers for record
  2558. syntaxes.  Names are assigned using the ASN.1 notation (ISO 8824) for
  2559. OBJECT IDENTIFIER values:
  2560.  
  2561. ANSI-Z39-50-2  DEFINITIONS ::=
  2562. BEGIN
  2563.  
  2564. Z39-50 OBJECT IDENTIFIER ::= { iso (1) member-body (2) US (840)
  2565. ANSI-standard-Z39.50 (10003)}
  2566.  
  2567. RecordSyntax OBJECT IDENTIFIER ::=  { Z39-50 (5) }
  2568.  
  2569. Unimarc ::=  OBJECT IDENTIFIER { RecordSyntax (1) }
  2570. Intermarc ::=  OBJECT IDENTIFIER { RecordSyntax (2) }
  2571. CCF ::= OBJECT IDENTIFIER { RecordSyntax (3) } 
  2572. US-MARC ::= OBJECT IDENTIFIER { RecordSyntax (10) }
  2573. UK-MARC ::= OBJECT IDENTIFIER { RecordSyntax (11) }
  2574. NORMARC ::= OBJECT IDENTIFIER { RecordSyntax (12) }
  2575. LIBRISMARC ::= OBJECT IDENTIFIER { RecordSyntax (13) }
  2576. DANMARC ::= OBJECT IDENTIFIER { RecordSyntax (14) }
  2577. FINMARC ::= OBJECT IDENTIFIER { RecordSyntax (15) }
  2578. MAB1 ::= OBJECT IDENTIFIER { RecordSyntax (16) }
  2579. CAN/MARC ::= OBJECT IDENTIFIER { RecordSyntax (17) }
  2580. SBN ::= OBJECT IDENTIFIER { RecordSyntax (18) }
  2581. PICAMARC ::= OBJECT IDENTIFIER { RecordSyntax (19) }
  2582.  
  2583. END
  2584.  
  2585.  
  2586.  
  2587. NOTES: 
  2588.    (1) The above object identifiers are intended to be used as the values
  2589. of PreferredRecordSyntax in Search and Present APDUs.
  2590.    (2) For the purposes of Presentation Context negotiation, record syntax
  2591. is identified by a pair of object identifiers, one from the above list for
  2592. the abstract-syntax and one for the transfer syntax.  No object identifiers
  2593. are assigned by this standard for transfer syntax for bibliographic
  2594. records.  However, an object identifiers has been assigned (outside of this
  2595. standard) for the transfer-syntax for bibliographic records defined in ISO
  2596. 2709:
  2597.  
  2598.  { iso standard 2709 transfer-syntax  (1) character-encoding (1) }
  2599.  
  2600.  
  2601. APPENDIX F:  Resource Report Format bib-1
  2602.  
  2603.          This appendix is part of the standard.  
  2604.  
  2605.          This Appendix defines the resource report format bib-1.  The
  2606. object identifier for resource report format bib-1 is defined and
  2607. registered in Appendix A.
  2608.  
  2609.  
  2610.          When the value of ResourceReportId (within ResourceReport within
  2611. the auxiliary definitions for the Resource Request APDU) equals the object
  2612. identifier for this resource report format, then EstimateType (within
  2613. Estimate) takes values from the "type" column in the table below.
  2614.  
  2615. Type               Meaning
  2616.  
  2617. 1                  estimate of current result for search
  2618. 2                  estimate of result at end of search if it completes
  2619. 3                  estimate of current result for present
  2620. 4                  estimate of result at end of present if it completes
  2621. 5                  processing time used by this command so far
  2622. 6                  estimated total processing time for command if allowed to complete
  2623. 7                  estimate of processing time used by association so far
  2624. 8                  estimate of cost for this command so far
  2625. 9                  estimate of cost for command if completed
  2626. 10                 estimate of cost for this association so far
  2627.